]> git.donarmstrong.com Git - rsem.git/blobdiff - boost/fusion/sequence/intrinsic/size.hpp
Updated boost to v1.55.0
[rsem.git] / boost / fusion / sequence / intrinsic / size.hpp
index 2a3cb7f8230d8747677d10297131ca0debfe25e3..0a1c1659b25ef414ff8ec6075c075a8882dfbd90 100644 (file)
@@ -1,5 +1,5 @@
 /*=============================================================================
-    Copyright (c) 2001-2006 Joel de Guzman
+    Copyright (c) 2001-2011 Joel de Guzman
 
     Distributed under the Boost Software License, Version 1.0. (See accompanying 
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -7,8 +7,13 @@
 #if !defined(FUSION_SIZE_05052005_0214)
 #define FUSION_SIZE_05052005_0214
 
+#include <boost/utility/enable_if.hpp>
+#include <boost/mpl/if.hpp>
 #include <boost/mpl/int.hpp>
+#include <boost/fusion/sequence/intrinsic_fwd.hpp>
 #include <boost/fusion/support/tag_of.hpp>
+#include <boost/fusion/support/is_segmented.hpp>
+#include <boost/fusion/sequence/intrinsic/detail/segmented_size.hpp>
 
 namespace boost { namespace fusion
 {
@@ -24,8 +29,17 @@ namespace boost { namespace fusion
         template <typename Tag>
         struct size_impl
         {
+            template<typename Sequence>
+            struct unsegmented_size : Sequence::size {};
+
             template <typename Sequence>
-            struct apply : Sequence::size {};
+            struct apply
+              : mpl::if_<
+                    traits::is_segmented<Sequence>
+                  , detail::segmented_size<Sequence>
+                  , unsegmented_size<Sequence>
+                >::type
+            {};
         };
 
         template <>