Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59624 - in sandbox/SOC/2009/fusion/boost/fusion/adapted: class detail/class detail/struct struct
From: mr.chr.schmidt_at_[hidden]
Date: 2010-02-10 15:37:28


Author: cschmidt
Date: 2010-02-10 15:37:26 EST (Wed, 10 Feb 2010)
New Revision: 59624
URL: http://svn.boost.org/trac/boost/changeset/59624

Log:
adapt template classes/structs
Text files modified:
   sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_assoc_class.hpp | 67 ++++++++++++++-----
   sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_assoc_class_named.hpp | 24 +++---
   sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_class.hpp | 26 +++++--
   sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_class_named.hpp | 22 +++---
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/adapt_base.hpp | 39 ++++++----
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp | 138 +++++++++++++++++++++++++++++----------
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/proxy_type.hpp | 28 ++++---
   sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct.hpp | 53 +++++++++-----
   sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp | 35 +++++----
   sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct.hpp | 30 +++++--
   sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct_named.hpp | 34 +++++----
   11 files changed, 320 insertions(+), 176 deletions(-)

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_assoc_class.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_assoc_class.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_assoc_class.hpp 2010-02-10 15:37:26 EST (Wed, 10 Feb 2010)
@@ -5,8 +5,27 @@
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
 
-#ifndef BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_NAMED_HPP
-#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_NAMED_HPP
+#ifndef BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_HPP
+#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_HPP
+
+#include <boost/fusion/support/internal/ref.hpp>
+#include <boost/preprocessor/empty.hpp>
+
+#include <boost/fusion/adapted/detail/class/extension.hpp>
+#include <boost/fusion/adapted/detail/class/adapt_base.hpp>
+#include <boost/fusion/adapted/detail/class/at_impl.hpp>
+#include <boost/fusion/adapted/detail/class/is_view_impl.hpp>
+#include <boost/fusion/adapted/detail/class/is_sequence_impl.hpp>
+#include <boost/fusion/adapted/detail/class/value_at_impl.hpp>
+#include <boost/fusion/adapted/detail/class/category_of_impl.hpp>
+#include <boost/fusion/adapted/detail/class/size_impl.hpp>
+#include <boost/fusion/adapted/detail/class/begin_impl.hpp>
+#include <boost/fusion/adapted/detail/class/end_impl.hpp>
+#include <boost/fusion/adapted/detail/class/value_of_impl.hpp>
+#include <boost/fusion/adapted/detail/class/deref_impl.hpp>
+#include <boost/fusion/adapted/detail/class/deref_data_impl.hpp>
+#include <boost/fusion/adapted/detail/class/key_of_impl.hpp>
+#include <boost/fusion/adapted/detail/class/value_of_data_impl.hpp>
 
 #define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0(A, B, C, D, E)\
     ((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1
@@ -15,23 +34,35 @@
 #define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0_END
 #define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1_END
 
-#define BOOST_FUSION_ADAPT_ASSOC_CLASS(NAME, SEQ)\
- BOOST_FUSION_ADAPT_STRUCT_BASE(\
- NAME,\
- assoc_class_tag,\
- BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 SEQ,_END),\
- BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
-
-#define BOOST_FUSION_ADAPT_ASSOC_CLASS_C(R, NAME, I, TUPLE)\
- BOOST_FUSION_ADAPT_STRUCT_C_BASE(NAME, I, PREFIX, TUPLE, 5) \
+#define BOOST_FUSION_ADAPT_ASSOC_CLASS_C( \
+ TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
+ \
+ BOOST_FUSION_ADAPT_CLASS_C_BASE(TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,5) \
                                                                                 \
-namespace boost { namespace fusion { namespace extension \
-{ \
- template<> \
- struct struct_assoc_key<NAME, I> \
+ template< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
+ > \
+ struct struct_assoc_key<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
     { \
- typedef BOOST_PP_TUPLE_ELEM(5, 4, TUPLE) type; \
- }; \
-}}}
+ typedef BOOST_PP_TUPLE_ELEM(5, 4, ATTRIBUTE) type; \
+ };
+
+#define BOOST_FUSION_ADAPT_ASSOC_TPL_CLASS( \
+ TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \
+ \
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (1)TEMPLATE_PARAMS_SEQ, \
+ (1)NAME_SEQ, \
+ assoc_class_tag, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
+ BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
+
+#define BOOST_FUSION_ADAPT_ASSOC_CLASS(NAME, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (0), \
+ (0)(NAME), \
+ assoc_class_tag, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \
+ BOOST_FUSION_ADAPT_ASSOC_CLASS_C)
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_assoc_class_named.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_assoc_class_named.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_assoc_class_named.hpp 2010-02-10 15:37:26 EST (Wed, 10 Feb 2010)
@@ -11,19 +11,17 @@
 #include <boost/fusion/adapted/class/adapt_assoc_class.hpp>
 #include <boost/fusion/adapted/detail/struct/proxy_type.hpp>
 
-#define BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED(WRAPPED_TYPE, NAME, SEQ)\
- BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED_NS(\
- WRAPPED_TYPE,\
- (boost)(fusion)(adapted),\
- NAME,\
- SEQ)
+#define BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED_NS( \
+ WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
+ \
+ BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE(WRAPPED_TYPE,NAMESPACE_SEQ,NAME)\
+ \
+ BOOST_FUSION_ADAPT_ASSOC_CLASS( \
+ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(NAMESPACE_SEQ)NAME, \
+ ATTRIBUTES)
 
-#define BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED_NS(\
- WRAPPED_TYPE, NAMESPACE, NAME, SEQ)\
- \
- BOOST_FUSION_DEFINE_PROXY_TYPE(WRAPPED_TYPE,NAMESPACE,NAME)\
- BOOST_FUSION_ASSOC_ADAPT_CLASS(\
- BOOST_FUSION_NAMESPACE_DECLARATION(NAMESPACE)NAME,\
- SEQ)
+#define BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED_NS( \
+ WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_class.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_class.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_class.hpp 2010-02-10 15:37:26 EST (Wed, 10 Feb 2010)
@@ -10,6 +10,7 @@
 
 #include <boost/fusion/support/internal/ref.hpp>
 #include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/empty.hpp>
 
 #include <boost/fusion/adapted/detail/class/extension.hpp>
 #include <boost/fusion/adapted/detail/class/adapt_base.hpp>
@@ -31,14 +32,25 @@
 #define BOOST_FUSION_ADAPT_CLASS_FILLER_0_END
 #define BOOST_FUSION_ADAPT_CLASS_FILLER_1_END
 
-#define BOOST_FUSION_ADAPT_CLASS(NAME, SEQ)\
- BOOST_FUSION_ADAPT_STRUCT_BASE(\
- NAME,\
- class_tag,\
- BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 SEQ,_END),\
+#define BOOST_FUSION_ADAPT_CLASS_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \
+ BOOST_FUSION_ADAPT_CLASS_C_BASE( \
+ TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE, 4)
+
+#define BOOST_FUSION_ADAPT_TPL_CLASS(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES)\
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (1)TEMPLATE_PARAMS_SEQ, \
+ (1)NAME_SEQ, \
+ class_tag, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
+ BOOST_FUSION_ADAPT_CLASS_C)
+
+#define BOOST_FUSION_ADAPT_CLASS(NAME, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (0), \
+ (0)(NAME), \
+ class_tag, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \
         BOOST_FUSION_ADAPT_CLASS_C)
 
-#define BOOST_FUSION_ADAPT_CLASS_C(R, NAME, I, TUPLE)\
- BOOST_FUSION_ADAPT_CLASS_C_BASE(NAME, I, TUPLE, 4)
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_class_named.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_class_named.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_class_named.hpp 2010-02-10 15:37:26 EST (Wed, 10 Feb 2010)
@@ -11,17 +11,17 @@
 #include <boost/fusion/adapted/class/adapt_class.hpp>
 #include <boost/fusion/adapted/detail/struct/proxy_type.hpp>
 
-#define BOOST_FUSION_ADAPT_CLASS_NAMED(WRAPPED_TYPE, NAME, SEQ)\
- BOOST_FUSION_ADAPT_CLASS_NAMED_NS(\
- WRAPPED_TYPE,\
- (boost)(fusion)(adapted),\
- NAME,\
- SEQ)
+#define BOOST_FUSION_ADAPT_CLASS_NAMED_NS( \
+ WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
+ \
+ BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE(WRAPPED_TYPE,NAMESPACE_SEQ,NAME)\
+ \
+ BOOST_FUSION_ADAPT_CLASS( \
+ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(NAMESPACE_SEQ)NAME, \
+ ATTRIBUTES)
 
-#define BOOST_FUSION_ADAPT_CLASS_NAMED_NS(WRAPPED_TYPE, NAMESPACE, NAME, SEQ)\
- BOOST_FUSION_DEFINE_PROXY_TYPE(WRAPPED_TYPE,NAMESPACE,NAME)\
- BOOST_FUSION_ADAPT_CLASS(\
- BOOST_FUSION_NAMESPACE_DECLARATION(NAMESPACE)NAME,\
- SEQ)
+#define BOOST_FUSION_ADAPT_CLASS_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_CLASS_NAMED_NS( \
+ WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/adapt_base.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/adapt_base.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/adapt_base.hpp 2010-02-10 15:37:26 EST (Wed, 10 Feb 2010)
@@ -10,20 +10,26 @@
 
 #include <boost/fusion/adapted/detail/struct/adapt_base.hpp>
 
-#define BOOST_FUSION_ADAPT_CLASS_C_BASE(NAME, I, TUPLE, MAX_SIZE) \
-namespace boost { namespace fusion { namespace extension \
-{ \
- template <> \
- struct struct_member<NAME, I> \
+#define BOOST_FUSION_ADAPT_CLASS_C_BASE(\
+ TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \
+ \
+ template< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
+ > \
+ struct struct_member<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
     { \
- typedef BOOST_PP_TUPLE_ELEM(MAX_SIZE, 0, TUPLE) type; \
- typedef BOOST_PP_TUPLE_ELEM(MAX_SIZE, 1, TUPLE) get_type; \
+ typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \
+ typedef \
+ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \
+ get_type; \
                                                                                 \
         struct proxy \
         { \
- typedef BOOST_PP_TUPLE_ELEM(MAX_SIZE, 0, TUPLE) type; \
+ typedef \
+ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
+ type; \
                                                                                 \
- proxy(NAME& obj) \
+ proxy(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \
               : obj(obj) \
             {} \
                                                                                 \
@@ -31,30 +37,29 @@
             proxy& \
             operator=(BOOST_FUSION_R_ELSE_CLREF(Arg) val) \
             { \
- BOOST_PP_TUPLE_ELEM(MAX_SIZE, 3, TUPLE); \
+ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \
                 return *this; \
             } \
                                                                                 \
             operator type() \
             { \
- return BOOST_PP_TUPLE_ELEM(MAX_SIZE, 2, TUPLE); \
+ return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
             } \
                                                                                 \
- NAME& obj; \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
         }; \
                                                                                 \
         static get_type \
- call(NAME const& obj) \
+ call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \
         { \
- return BOOST_PP_TUPLE_ELEM(MAX_SIZE, 2, TUPLE); \
+ return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
         }; \
                                                                                 \
         static proxy \
- call(NAME& obj) \
+ call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \
         { \
             return proxy(obj); \
         }; \
- }; \
-}}}
+ };
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp 2010-02-10 15:37:26 EST (Wed, 10 Feb 2010)
@@ -1,5 +1,5 @@
 /*=============================================================================
- Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-2010 Christopher Schmidt
 
     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)
@@ -11,30 +11,95 @@
 #include <boost/config.hpp>
 #include <boost/fusion/support/tag_of_fwd.hpp>
 
-#include <boost/mpl/tag.hpp>
+#include <boost/preprocessor/control/if.hpp>
 #include <boost/preprocessor/seq/size.hpp>
+#include <boost/preprocessor/seq/for_each.hpp>
 #include <boost/preprocessor/seq/for_each_i.hpp>
+#include <boost/preprocessor/seq/enum.hpp>
+#include <boost/preprocessor/seq/seq.hpp>
+#include <boost/preprocessor/tuple/eat.hpp>
 #include <boost/preprocessor/tuple/elem.hpp>
-#include <boost/preprocessor/tuple/elem.hpp>
+#include <boost/mpl/tag.hpp>
+
+#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS(SEQ) \
+ BOOST_PP_SEQ_HEAD(SEQ)<BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TAIL(SEQ))>
+#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(SEQ) \
+ BOOST_PP_IF( \
+ BOOST_PP_SEQ_HEAD(SEQ), \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS, \
+ BOOST_PP_SEQ_HEAD)(BOOST_PP_SEQ_TAIL(SEQ))
+
+#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL_C(R, _, ELEM) \
+ (typename ELEM)
+#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL(SEQ) \
+ BOOST_PP_SEQ_ENUM( \
+ BOOST_PP_SEQ_FOR_EACH( \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL_C, \
+ _, \
+ BOOST_PP_SEQ_TAIL(SEQ)))
+#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(SEQ) \
+ BOOST_PP_IF( \
+ BOOST_PP_SEQ_HEAD(SEQ), \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL, \
+ BOOST_PP_TUPLE_EAT(1))(SEQ)
 
 #ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
 # define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION(MODIFIER, DATA) \
- template <> \
- struct tag_of<BOOST_PP_TUPLE_ELEM(2,0,DATA) MODIFIER,void> \
+ template< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
+ BOOST_PP_TUPLE_ELEM(3,0,DATA)) \
+ > \
+ struct tag_of< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(BOOST_PP_TUPLE_ELEM(3,1,DATA)) \
+ MODIFIER \
+ , void \
+ > \
     { \
- typedef BOOST_PP_TUPLE_ELEM(2,1,DATA) type; \
+ typedef BOOST_PP_TUPLE_ELEM(3,2,DATA) type; \
     };
 #else
 # define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION(MODIFIER, DATA) \
- template <> \
- struct tag_of<BOOST_PP_TUPLE_ELEM(2,0,DATA) MODIFIER> \
+ template< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
+ BOOST_PP_TUPLE_ELEM(3,0,DATA)) \
+ > \
+ struct tag_of< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(BOOST_PP_TUPLE_ELEM(3,1,DATA)) \
+ MODIFIER \
+ > \
     { \
- typedef BOOST_PP_TUPLE_ELEM(2,1,DATA) type; \
+ typedef BOOST_PP_TUPLE_ELEM(3,2,DATA) type; \
     };
 #endif
 
-#define BOOST_FUSION_ADAPT_STRUCT_BASE(NAME,TAG,SEQ,CALLBACK) \
- BOOST_PP_SEQ_FOR_EACH_I(CALLBACK,NAME,SEQ) \
+#define BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL(R,DATA,I,ATTRIBUTE) \
+ BOOST_PP_TUPLE_ELEM(3,0,DATA)( \
+ BOOST_PP_TUPLE_ELEM(3,1,DATA), \
+ BOOST_PP_TUPLE_ELEM(3,2,DATA), \
+ I, \
+ ATTRIBUTE)
+
+#define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
+ TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \
+ \
+ template< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
+ > \
+ struct struct_member<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
+ { \
+ typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \
+ \
+ template<typename Seq> \
+ static typename detail::forward_as<Seq&,type>::type \
+ call(Seq& seq) \
+ { \
+ return seq.PREFIX \
+ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \
+ } \
+ };
+
+#define BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG,ATTRIBUTES_SEQ,ATTRIBUTES_CALLBACK) \
                                                                                 \
 namespace boost \
 { \
@@ -43,14 +108,24 @@
         namespace traits \
         { \
             BOOST_FUSION_ALL_CV_REF_NON_REF_COMBINATIONS( \
- BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION,(NAME,TAG)) \
+ BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION, \
+ (TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG)) \
         } \
                                                                                 \
         namespace extension \
         { \
- template <> \
- struct struct_size<NAME> \
- : mpl::int_<BOOST_PP_SEQ_SIZE(SEQ)> \
+ BOOST_PP_SEQ_FOR_EACH_I_R( \
+ 1, \
+ BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL, \
+ (ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ), \
+ ATTRIBUTES_SEQ) \
+ \
+ template< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
+ TEMPLATE_PARAMS_SEQ) \
+ > \
+ struct struct_size<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)> \
+ : mpl::int_<BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)> \
             {}; \
         } \
     } \
@@ -60,35 +135,26 @@
         template<typename> \
         struct sequence_tag; \
                                                                                 \
- template <> \
- struct sequence_tag<NAME> \
+ template< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
+ TEMPLATE_PARAMS_SEQ) \
+ > \
+ struct sequence_tag<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)> \
         { \
             typedef fusion::fusion_sequence_tag type; \
         }; \
                                                                                 \
- template <> \
- struct sequence_tag<NAME const> \
+ template< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \
+ TEMPLATE_PARAMS_SEQ) \
+ > \
+ struct sequence_tag< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const \
+ > \
         { \
             typedef fusion::fusion_sequence_tag type; \
         }; \
     } \
 }
 
-#define BOOST_FUSION_ADAPT_STRUCT_C_BASE(NAME, I, PREFIX, TUPLE, MAX_SIZE) \
-namespace boost { namespace fusion { namespace extension \
-{ \
- template <> \
- struct struct_member<NAME, I> \
- { \
- typedef BOOST_PP_TUPLE_ELEM(MAX_SIZE, 0, TUPLE) type; \
- \
- template<typename Seq> \
- static typename detail::forward_as<Seq&,type>::type \
- call(Seq& seq) \
- { \
- return seq.PREFIX BOOST_PP_TUPLE_ELEM(MAX_SIZE, 1, TUPLE); \
- } \
- }; \
-}}}
-
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/proxy_type.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/proxy_type.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/proxy_type.hpp 2010-02-10 15:37:26 EST (Wed, 10 Feb 2010)
@@ -12,12 +12,16 @@
 #include <boost/preprocessor/seq/size.hpp>
 #include <boost/preprocessor/repetition/repeat.hpp>
 
-#define BOOST_FUSION_PROXY_TYPE_NS_BEGIN(R,DATA,ELEM) namespace ELEM {
-#define BOOST_FUSION_PROXY_TYPE_NS_END(Z,I,DATA) }
-#define BOOST_FUSION_NAMESPACE_DECLARATION_I(Z,I,ELEM) ELEM::
+#define BOOST_FUSION_ADAPT_STRUCT_PROXY_TYPE_NS_BEGIN(R,DATA,ELEM) \
+ namespace ELEM {
+#define BOOST_FUSION_ADAPT_STRUCT_PROXY_TYPE_NS_END(Z,I,DATA) }
+#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION_I(Z,I,ELEM) ELEM::
 
-#define BOOST_FUSION_DEFINE_PROXY_TYPE(WRAPPED_TYPE,NAMESPACE,NAME) \
- BOOST_PP_SEQ_FOR_EACH_R(1, BOOST_FUSION_PROXY_TYPE_NS_BEGIN, _, NAMESPACE) \
+#define BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE( \
+ WRAPPED_TYPE,NAMESPACE_SEQ,NAME) \
+ \
+ BOOST_PP_SEQ_FOR_EACH_R( \
+ 1, BOOST_FUSION_ADAPT_STRUCT_PROXY_TYPE_NS_BEGIN, _, NAMESPACE_SEQ) \
                                                                                 \
     struct NAME \
     { \
@@ -28,15 +32,13 @@
         WRAPPED_TYPE& obj; \
     }; \
                                                                                 \
- BOOST_PP_REPEAT_1(BOOST_PP_SEQ_SIZE(NAMESPACE), \
- BOOST_FUSION_PROXY_TYPE_NS_END, \
+ BOOST_PP_REPEAT_1( \
+ BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ), \
+ BOOST_FUSION_ADAPT_STRUCT_PROXY_TYPE_NS_END, \
         _)
 
-#define BOOST_FUSION_NAMESPACE_DECLARATION(NAMESPACE)\
- BOOST_PP_SEQ_FOR_EACH_R(\
- 1,\
- BOOST_FUSION_NAMESPACE_DECLARATION_I,\
- _,\
- NAMESPACE)
+#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(NAMESPACE_SEQ) \
+ BOOST_PP_SEQ_FOR_EACH_R( \
+ 1,BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION_I,_,NAMESPACE_SEQ)
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct.hpp 2010-02-10 15:37:26 EST (Wed, 10 Feb 2010)
@@ -1,7 +1,7 @@
 /*=============================================================================
     Copyright (c) 2001-2007 Joel de Guzman
     Copyright (c) 2007 Dan Marsden
- Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-2010 Christopher Schmidt
 
     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)
@@ -38,27 +38,42 @@
 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END
 #define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END
 
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT(NAME, SEQ)\
- BOOST_FUSION_ADAPT_STRUCT_BASE(\
- NAME,\
- assoc_struct_tag,\
- BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 SEQ,_END),\
- BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \
+ TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE) \
+ \
+ BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
+ TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, BOOST_PP_EMPTY(), ATTRIBUTE, 3) \
+ \
+ template< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
+ > \
+ struct struct_assoc_key<BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ), I> \
+ { \
+ typedef BOOST_PP_TUPLE_ELEM(3, 2, ATTRIBUTE) type; \
+ };
 
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C(R, NAME, I, TUPLE)\
- BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE(NAME, I, BOOST_PP_EMPTY(), TUPLE)
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C( \
+ TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, ATTRIBUTE) \
+ \
+ BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \
+ TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY(),ATTRIBUTE)
 
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE(NAME, I, PREFIX, TUPLE) \
- BOOST_FUSION_ADAPT_STRUCT_C_BASE(NAME, I, PREFIX, TUPLE, 3) \
+#define BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \
+ TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \
                                                                                 \
-namespace boost { namespace fusion { namespace extension \
-{ \
- template<> \
- struct struct_assoc_key<NAME, I> \
- { \
- typedef BOOST_PP_TUPLE_ELEM(3, 2, TUPLE) type; \
- }; \
-}}}
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (1)TEMPLATE_PARAMS_SEQ, \
+ (1)NAME_SEQ, \
+ assoc_struct_tag, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
+ BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
 
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT(NAME, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (0), \
+ (0)(NAME), \
+ assoc_struct_tag, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \
+ BOOST_FUSION_ADAPT_ASSOC_STRUCT_C)
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp 2010-02-10 15:37:26 EST (Wed, 10 Feb 2010)
@@ -11,25 +11,26 @@
 #include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
 #include <boost/fusion/adapted/detail/struct/proxy_type.hpp>
 
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(WRAPPED_TYPE, NAME, SEQ)\
- BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS(\
- WRAPPED_TYPE,\
- (boost)(fusion)(adapted),\
- NAME,\
- SEQ)
+#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_NS(\
- WRAPPED_TYPE, NAMESPACE, NAME, SEQ)\
- \
- BOOST_FUSION_DEFINE_PROXY_TYPE(WRAPPED_TYPE,NAMESPACE,NAME)\
- \
- BOOST_FUSION_ADAPT_ASSOC_STRUCT_BASE(\
- BOOST_FUSION_NAMESPACE_DECLARATION(NAMESPACE)NAME,\
- struct_tag,\
- BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 SEQ,_END),\
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \
+ WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
+ \
+ BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE(WRAPPED_TYPE,NAMESPACE_SEQ,NAME)\
+ \
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (0), \
+ (0)(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(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)
 
-#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_C(R, NAME, I, SEQ)\
- BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE(NAME, I, obj., SEQ)
+#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \
+ WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct.hpp 2010-02-10 15:37:26 EST (Wed, 10 Feb 2010)
@@ -1,6 +1,6 @@
 /*=============================================================================
     Copyright (c) 2001-2007 Joel de Guzman
- Copyright (c) 2009 Christopher Schmidt
+ Copyright (c) 2009-2010 Christopher Schmidt
 
     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)
@@ -26,21 +26,31 @@
 #include <boost/fusion/adapted/detail/struct/value_of_impl.hpp>
 #include <boost/fusion/adapted/detail/struct/deref_impl.hpp>
 
-#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y)\
+#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \
     ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_1
-#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y)\
+#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \
     ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_0
 #define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END
 #define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END
 
-#define BOOST_FUSION_ADAPT_STRUCT(NAME, SEQ)\
- BOOST_FUSION_ADAPT_STRUCT_BASE(\
- NAME,\
- struct_tag,\
- BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 SEQ,_END),\
+#define BOOST_FUSION_ADAPT_STRUCT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)\
+ BOOST_FUSION_ADAPT_STRUCT_C_BASE( \
+ TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY(),ATTRIBUTE,2)
+
+#define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (1)TEMPLATE_PARAMS_SEQ, \
+ (1)NAME_SEQ, \
+ struct_tag, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
         BOOST_FUSION_ADAPT_STRUCT_C)
 
-#define BOOST_FUSION_ADAPT_STRUCT_C(R, NAME, I, TUPLE)\
- BOOST_FUSION_ADAPT_STRUCT_C_BASE(NAME, I, BOOST_PP_EMPTY(), TUPLE, 2)
+#define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (0), \
+ (0)(NAME), \
+ struct_tag, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
+ BOOST_FUSION_ADAPT_STRUCT_C)
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct_named.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct_named.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct_named.hpp 2010-02-10 15:37:26 EST (Wed, 10 Feb 2010)
@@ -10,24 +10,28 @@
 
 #include <boost/fusion/adapted/struct/adapt_struct.hpp>
 #include <boost/fusion/adapted/detail/struct/proxy_type.hpp>
+#include <boost/preprocessor/empty.hpp>
 
-#define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, SEQ)\
- BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(\
- WRAPPED_TYPE,\
- (boost)(fusion)(adapted),\
- NAME,\
- SEQ)
+#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_NS(WRAPPED_TYPE, NAMESPACE, NAME, SEQ)\
- BOOST_FUSION_DEFINE_PROXY_TYPE(WRAPPED_TYPE,NAMESPACE,NAME)\
- \
- BOOST_FUSION_ADAPT_STRUCT_BASE(\
- BOOST_FUSION_NAMESPACE_DECLARATION(NAMESPACE)NAME,\
- struct_tag,\
- BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 SEQ,_END),\
+#define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
+ WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \
+ \
+ BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE(WRAPPED_TYPE,NAMESPACE_SEQ,NAME)\
+ \
+ BOOST_FUSION_ADAPT_STRUCT_BASE( \
+ (0), \
+ (0)(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(NAMESPACE_SEQ)NAME),\
+ struct_tag, \
+ BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \
         BOOST_FUSION_ADAPT_STRUCT_NAMED_C)
 
-#define BOOST_FUSION_ADAPT_STRUCT_NAMED_C(R, NAME, I, TUPLE)\
- BOOST_FUSION_ADAPT_STRUCT_C_BASE(NAME, I, obj., TUPLE, 2)
+#define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \
+ BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \
+ WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES)
 
 #endif


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