Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61833 - in trunk: boost/fusion/adapted/class boost/fusion/adapted/struct boost/fusion/adapted/struct/detail libs/fusion/test/sequence
From: mr.chr.schmidt_at_[hidden]
Date: 2010-05-07 09:37:36


Author: cschmidt
Date: 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
New Revision: 61833
URL: http://svn.boost.org/trac/boost/changeset/61833

Log:
adapted proxy types are views now
Text files modified:
   trunk/boost/fusion/adapted/class/adapt_assoc_class.hpp | 11 +++++++++++
   trunk/boost/fusion/adapted/class/adapt_assoc_class_named.hpp | 2 +-
   trunk/boost/fusion/adapted/class/adapt_class.hpp | 11 +++++++++++
   trunk/boost/fusion/adapted/class/adapt_class_named.hpp | 2 +-
   trunk/boost/fusion/adapted/struct/adapt_assoc_struct.hpp | 15 +++++++++++++--
   trunk/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp | 22 ++++++++++------------
   trunk/boost/fusion/adapted/struct/adapt_struct.hpp | 11 +++++++++++
   trunk/boost/fusion/adapted/struct/adapt_struct_named.hpp | 21 +++++++++------------
   trunk/boost/fusion/adapted/struct/detail/adapt_base.hpp | 18 +++++++++++++++++-
   trunk/boost/fusion/adapted/struct/detail/extension.hpp | 8 ++++++--
   trunk/boost/fusion/adapted/struct/detail/is_view_impl.hpp | 4 +---
   trunk/libs/fusion/test/sequence/adapt_assoc_class_named.cpp | 2 +-
   trunk/libs/fusion/test/sequence/adapt_assoc_struct_named.cpp | 2 +-
   trunk/libs/fusion/test/sequence/adapt_class_named.cpp | 2 +-
   trunk/libs/fusion/test/sequence/adapt_struct_named.cpp | 2 +-
   15 files changed, 95 insertions(+), 38 deletions(-)

Modified: trunk/boost/fusion/adapted/class/adapt_assoc_class.hpp
==============================================================================
--- trunk/boost/fusion/adapted/class/adapt_assoc_class.hpp (original)
+++ trunk/boost/fusion/adapted/class/adapt_assoc_class.hpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -62,6 +62,7 @@
         (1)TEMPLATE_PARAMS_SEQ, \
         (1)NAME_SEQ, \
         assoc_struct_tag, \
+ 0, \
         BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
         BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
 
@@ -70,6 +71,16 @@
         (0), \
         (0)(NAME), \
         assoc_struct_tag, \
+ 0, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
+ BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
+
+#define BOOST_FUSION_ADAPT_ASSOC_CLASS_AS_VIEW(NAME, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (0), \
+ (0)(NAME), \
+ assoc_struct_tag, \
+ 1, \
         BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
         BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
 

Modified: trunk/boost/fusion/adapted/class/adapt_assoc_class_named.hpp
==============================================================================
--- trunk/boost/fusion/adapted/class/adapt_assoc_class_named.hpp (original)
+++ trunk/boost/fusion/adapted/class/adapt_assoc_class_named.hpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -17,7 +17,7 @@
     BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
         WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
                                                                                 \
- BOOST_FUSION_ADAPT_ASSOC_CLASS( \
+ BOOST_FUSION_ADAPT_ASSOC_CLASS_AS_VIEW( \
         BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
         ATTRIBUTES)
 

Modified: trunk/boost/fusion/adapted/class/adapt_class.hpp
==============================================================================
--- trunk/boost/fusion/adapted/class/adapt_class.hpp (original)
+++ trunk/boost/fusion/adapted/class/adapt_class.hpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -48,6 +48,7 @@
         (1)TEMPLATE_PARAMS_SEQ, \
         (1)NAME_SEQ, \
         struct_tag, \
+ 0, \
         BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
         BOOST_FUSION_ADAPT_CLASS_C)
 
@@ -56,6 +57,16 @@
         (0), \
         (0)(NAME), \
         struct_tag, \
+ 0, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
+ BOOST_FUSION_ADAPT_CLASS_C)
+
+#define BOOST_FUSION_ADAPT_CLASS_AS_VIEW(NAME, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (0), \
+ (0)(NAME), \
+ struct_tag, \
+ 1, \
         BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
         BOOST_FUSION_ADAPT_CLASS_C)
 

Modified: trunk/boost/fusion/adapted/class/adapt_class_named.hpp
==============================================================================
--- trunk/boost/fusion/adapted/class/adapt_class_named.hpp (original)
+++ trunk/boost/fusion/adapted/class/adapt_class_named.hpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -19,7 +19,7 @@
     BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
         WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
                                                                                 \
- BOOST_FUSION_ADAPT_CLASS( \
+ BOOST_FUSION_ADAPT_CLASS_AS_VIEW( \
         BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
         ATTRIBUTES)
 

Modified: trunk/boost/fusion/adapted/struct/adapt_assoc_struct.hpp
==============================================================================
--- trunk/boost/fusion/adapted/struct/adapt_assoc_struct.hpp (original)
+++ trunk/boost/fusion/adapted/struct/adapt_assoc_struct.hpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -34,9 +34,9 @@
 #include <boost/fusion/adapted/struct/detail/key_of_impl.hpp>
 #include <boost/fusion/adapted/struct/detail/value_of_data_impl.hpp>
 
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z)\
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z) \
     ((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z)\
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z) \
     ((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0
 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END
 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END
@@ -68,6 +68,7 @@
         (1)TEMPLATE_PARAMS_SEQ, \
         (1)NAME_SEQ, \
         assoc_struct_tag, \
+ 0, \
         BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
         BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
 
@@ -76,6 +77,16 @@
         (0), \
         (0)(NAME), \
         assoc_struct_tag, \
+ 0, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
+ BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
+
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (0), \
+ (0)(NAME), \
+ assoc_struct_tag, \
+ 1, \
         BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
         BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
 

Modified: trunk/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp
==============================================================================
--- trunk/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp (original)
+++ trunk/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -11,11 +11,12 @@
 #include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
 #include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
 
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_C( \
- TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, ATTRIBUTE) \
- \
- BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \
- TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, obj., ATTRIBUTE)
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0(X, Y, Z) \
+ (X, obj.Y, Z) BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1(X, Y, Z) \
+ (X, obj.Y, Z) BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0_END
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_1_END
 
 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \
     WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
@@ -23,13 +24,10 @@
     BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
         WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
                                                                                 \
- BOOST_FUSION_ADAPT_STRUCT_BASE( \
- (0), \
- (0)(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \
- (0)NAMESPACE_SEQ)NAME), \
- assoc_struct_tag, \
- BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
- BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_C)
+ BOOST_FUSION_ADAPT_ASSOC_STRUCT_AS_VIEW( \
+ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
+ BOOST_PP_CAT( \
+ BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_FILLER_0 ATTRIBUTES,_END))
 
 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
     BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \

Modified: trunk/boost/fusion/adapted/struct/adapt_struct.hpp
==============================================================================
--- trunk/boost/fusion/adapted/struct/adapt_struct.hpp (original)
+++ trunk/boost/fusion/adapted/struct/adapt_struct.hpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -45,6 +45,7 @@
         (1)TEMPLATE_PARAMS_SEQ, \
         (1)NAME_SEQ, \
         struct_tag, \
+ 0, \
         BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
         BOOST_FUSION_ADAPT_STRUCT_C)
 
@@ -53,6 +54,16 @@
         (0), \
         (0)(NAME), \
         struct_tag, \
+ 0, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
+ BOOST_FUSION_ADAPT_STRUCT_C)
+
+#define BOOST_FUSION_ADAPT_STRUCT_AS_VIEW(NAME, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (0), \
+ (0)(NAME), \
+ struct_tag, \
+ 1, \
         BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
         BOOST_FUSION_ADAPT_STRUCT_C)
 

Modified: trunk/boost/fusion/adapted/struct/adapt_struct_named.hpp
==============================================================================
--- trunk/boost/fusion/adapted/struct/adapt_struct_named.hpp (original)
+++ trunk/boost/fusion/adapted/struct/adapt_struct_named.hpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -14,11 +14,12 @@
 #include <boost/fusion/adapted/struct/detail/proxy_type.hpp>
 #include <boost/preprocessor/empty.hpp>
 
-#define BOOST_FUSION_ADAPT_STRUCT_NAMED_C( \
- TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
- \
- BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
- TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, obj., ATTRIBUTE, 2)
+#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0(X, Y) \
+ (X, obj.Y) BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1
+#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1(X, Y) \
+ (X, obj.Y) BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0
+#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0_END
+#define BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_1_END
 
 #define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
     WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
@@ -26,13 +27,9 @@
     BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \
         WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
                                                                                 \
- BOOST_FUSION_ADAPT_STRUCT_BASE( \
- (0), \
- (0)(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \
- (0)NAMESPACE_SEQ)NAME), \
- struct_tag, \
- BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
- BOOST_FUSION_ADAPT_STRUCT_NAMED_C)
+ BOOST_FUSION_ADAPT_STRUCT_AS_VIEW( \
+ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_NAMED_FILLER_0 ATTRIBUTES,_END))
 
 #define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
     BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \

Modified: trunk/boost/fusion/adapted/struct/detail/adapt_base.hpp
==============================================================================
--- trunk/boost/fusion/adapted/struct/detail/adapt_base.hpp (original)
+++ trunk/boost/fusion/adapted/struct/detail/adapt_base.hpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -23,6 +23,7 @@
 #include <boost/preprocessor/seq/seq.hpp>
 #include <boost/preprocessor/tuple/eat.hpp>
 #include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/mpl/bool.hpp>
 #include <boost/mpl/tag.hpp>
 #include <boost/mpl/eval_if.hpp>
 #include <boost/mpl/identity.hpp>
@@ -141,7 +142,12 @@
     };
 
 #define BOOST_FUSION_ADAPT_STRUCT_BASE( \
- TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG,ATTRIBUTES_SEQ,ATTRIBUTES_CALLBACK) \
+ TEMPLATE_PARAMS_SEQ, \
+ NAME_SEQ, \
+ TAG, \
+ IS_VIEW, \
+ ATTRIBUTES_SEQ, \
+ ATTRIBUTES_CALLBACK) \
                                                                                 \
 namespace boost \
 { \
@@ -170,6 +176,16 @@
             struct struct_size<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)> \
               : mpl::int_<BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)> \
             {}; \
+ \
+ template< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
+ TEMPLATE_PARAMS_SEQ) \
+ > \
+ struct struct_is_view< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
+ > \
+ : mpl::BOOST_PP_IF(IS_VIEW,true_,false_) \
+ {}; \
         } \
     } \
                                                                                 \

Modified: trunk/boost/fusion/adapted/struct/detail/extension.hpp
==============================================================================
--- trunk/boost/fusion/adapted/struct/detail/extension.hpp (original)
+++ trunk/boost/fusion/adapted/struct/detail/extension.hpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -33,11 +33,15 @@
         template<typename Seq, int N>
         struct struct_member_name;
 
+ template<typename Seq>
+ struct struct_size;
+
+ template<typename Seq>
+ struct struct_is_view;
+
         template<typename Seq, int N>
         struct struct_assoc_key;
 
- template<typename Seq>
- struct struct_size;
     }
 }}
 

Modified: trunk/boost/fusion/adapted/struct/detail/is_view_impl.hpp
==============================================================================
--- trunk/boost/fusion/adapted/struct/detail/is_view_impl.hpp (original)
+++ trunk/boost/fusion/adapted/struct/detail/is_view_impl.hpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -10,8 +10,6 @@
 #ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_VIEW_IMPL_HPP
 #define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_VIEW_IMPL_HPP
 
-#include <boost/mpl/bool.hpp>
-
 namespace boost { namespace fusion { namespace extension
 {
     template<typename>
@@ -22,7 +20,7 @@
     {
         template<typename Seq>
         struct apply
- : mpl::false_
+ : struct_is_view<typename remove_const<Seq>::type>
         {};
     };
 

Modified: trunk/libs/fusion/test/sequence/adapt_assoc_class_named.cpp
==============================================================================
--- trunk/libs/fusion/test/sequence/adapt_assoc_class_named.cpp (original)
+++ trunk/libs/fusion/test/sequence/adapt_assoc_class_named.cpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -63,7 +63,7 @@
     std::cout << tuple_delimiter(", ");
 
     {
- BOOST_MPL_ASSERT_NOT((traits::is_view<adapted::point>));
+ BOOST_MPL_ASSERT((traits::is_view<adapted::point>));
         ns::point basep(123, 456);
         adapted::point p(basep);
 

Modified: trunk/libs/fusion/test/sequence/adapt_assoc_struct_named.cpp
==============================================================================
--- trunk/libs/fusion/test/sequence/adapt_assoc_struct_named.cpp (original)
+++ trunk/libs/fusion/test/sequence/adapt_assoc_struct_named.cpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -48,7 +48,7 @@
     std::cout << tuple_delimiter(", ");
 
     {
- BOOST_MPL_ASSERT_NOT((traits::is_view<adapted::point>));
+ BOOST_MPL_ASSERT((traits::is_view<adapted::point>));
         ns::point basep = {123, 456};
         adapted::point p(basep);
 

Modified: trunk/libs/fusion/test/sequence/adapt_class_named.cpp
==============================================================================
--- trunk/libs/fusion/test/sequence/adapt_class_named.cpp (original)
+++ trunk/libs/fusion/test/sequence/adapt_class_named.cpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -71,7 +71,7 @@
     std::cout << tuple_delimiter(", ");
 
     {
- BOOST_MPL_ASSERT_NOT((traits::is_view<adapted::point>));
+ BOOST_MPL_ASSERT((traits::is_view<adapted::point>));
         ns::point basep(123, 456);
         adapted::point p(basep);
 

Modified: trunk/libs/fusion/test/sequence/adapt_struct_named.cpp
==============================================================================
--- trunk/libs/fusion/test/sequence/adapt_struct_named.cpp (original)
+++ trunk/libs/fusion/test/sequence/adapt_struct_named.cpp 2010-05-07 09:37:34 EDT (Fri, 07 May 2010)
@@ -63,7 +63,7 @@
     std::cout << tuple_delimiter(", ");
 
     {
- BOOST_MPL_ASSERT_NOT((traits::is_view<adapted::point>));
+ BOOST_MPL_ASSERT((traits::is_view<adapted::point>));
         ns::point basep = {123, 456};
         adapted::point p(basep);
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk