Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59845 - in sandbox/SOC/2009/fusion: boost/fusion/adapted boost/fusion/adapted/class boost/fusion/adapted/detail/class boost/fusion/adapted/detail/struct boost/fusion/adapted/struct boost/fusion/sequence boost/fusion/sequence/convenience boost/fusion/support boost/fusion/support/internal boost/fusion/view/nview/detail libs/fusion/test libs/fusion/test/sequence
From: mr.chr.schmidt_at_[hidden]
Date: 2010-02-22 17:52:46


Author: cschmidt
Date: 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
New Revision: 59845
URL: http://svn.boost.org/trac/boost/changeset/59845

Log:
adapt template classes/structs (2)
Added:
   sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_class.cpp (contents, props changed)
   sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_class_named.cpp (contents, props changed)
   sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_struct_named.cpp (contents, props changed)
   sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_tpl_class.cpp (contents, props changed)
   sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_tpl_struct.cpp (contents, props changed)
   sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_tpl_class.cpp (contents, props changed)
   sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_tpl_struct.cpp (contents, props changed)
Text files modified:
   sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_assoc_class.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_assoc_class_named.hpp | 5 +
   sandbox/SOC/2009/fusion/boost/fusion/adapted/class/adapt_class_named.hpp | 5 +
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/adapt_base.hpp | 70 +++++++++++++++++++-----------
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/at_impl.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/deref_impl.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/proxy_type.hpp | 26 +++++++++--
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/size_impl.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/adapted/std_pair.hpp | 91 +++------------------------------------
   sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp | 6 +
   sandbox/SOC/2009/fusion/boost/fusion/adapted/struct/adapt_struct_named.hpp | 6 +
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience.hpp | 5 +
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/generate.hpp | 4
   sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/move.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/support/deduce.hpp | 3
   sandbox/SOC/2009/fusion/boost/fusion/support/internal/ref.hpp | 4 +
   sandbox/SOC/2009/fusion/boost/fusion/view/nview/detail/equal_to_impl.hpp | 3
   sandbox/SOC/2009/fusion/boost/fusion/view/nview/detail/nview_iterator.hpp | 5 +
   sandbox/SOC/2009/fusion/libs/fusion/test/Jamfile | 13 ++++-
   20 files changed, 115 insertions(+), 141 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-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -9,7 +9,9 @@
 #define BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_HPP
 
 #include <boost/fusion/support/internal/ref.hpp>
+#include <boost/preprocessor/cat.hpp>
 #include <boost/preprocessor/empty.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
 
 #include <boost/fusion/adapted/detail/class/extension.hpp>
 #include <boost/fusion/adapted/detail/class/adapt_base.hpp>

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-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -14,10 +14,11 @@
 #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_STRUCT_DEFINE_PROXY_TYPE( \
+ WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
                                                                                 \
     BOOST_FUSION_ADAPT_ASSOC_CLASS( \
- BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(NAMESPACE_SEQ)NAME, \
+ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
         ATTRIBUTES)
 
 #define BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \

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-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -14,10 +14,11 @@
 #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_STRUCT_DEFINE_PROXY_TYPE( \
+ WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
                                                                                 \
     BOOST_FUSION_ADAPT_CLASS( \
- BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(NAMESPACE_SEQ)NAME, \
+ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \
         ATTRIBUTES)
 
 #define BOOST_FUSION_ADAPT_CLASS_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \

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-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -16,38 +16,50 @@
     template< \
         BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \
> \
+ struct class_member_proxy< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
+ , I \
+ > \
+ { \
+ typedef \
+ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
+ type; \
+ \
+ class_member_proxy(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj)\
+ : obj(obj) \
+ {} \
+ \
+ template<class Arg> \
+ class_member_proxy& \
+ operator=(BOOST_FUSION_R_ELSE_CLREF(Arg) val) \
+ { \
+ BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \
+ return *this; \
+ } \
+ \
+ operator type() \
+ { \
+ return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
+ } \
+ \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
+ }; \
+ \
+ 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; \
         typedef \
             BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \
         get_type; \
- \
- struct proxy \
- { \
- typedef \
- BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) \
- type; \
- \
- proxy(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \
- : obj(obj) \
- {} \
- \
- template<class Arg> \
- proxy& \
- operator=(BOOST_FUSION_R_ELSE_CLREF(Arg) val) \
- { \
- BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \
- return *this; \
- } \
- \
- operator type() \
- { \
- return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \
- } \
- \
- BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \
- }; \
+ typedef \
+ class_member_proxy< \
+ BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \
+ , I \
+ > \
+ proxy; \
                                                                                 \
         static get_type \
         call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \
@@ -62,4 +74,10 @@
         }; \
     };
 
+namespace boost { namespace fusion { namespace extension
+{
+ template <typename T, int N>
+ struct class_member_proxy;
+}}}
+
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/at_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/at_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/at_impl.hpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -8,7 +8,6 @@
 #ifndef BOOST_FUSION_ADAPTED_DETAIL_CLASS_AT_IMPL_HPP
 #define BOOST_FUSION_ADAPTED_DETAIL_CLASS_AT_IMPL_HPP
 
-#include <boost/fusion/support/internal/ref.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/type_traits/is_const.hpp>
 #include <boost/type_traits/remove_const.hpp>

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/deref_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/deref_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/class/deref_impl.hpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -8,7 +8,6 @@
 #ifndef BOOST_FUSION_ADAPTED_DETAIL_CLASS_DEREF_IMPL_HPP
 #define BOOST_FUSION_ADAPTED_DETAIL_CLASS_DEREF_IMPL_HPP
 
-#include <boost/fusion/support/internal/ref.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/type_traits/is_const.hpp>
 #include <boost/type_traits/remove_const.hpp>

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-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -8,10 +8,14 @@
 #ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_PROXY_TYPE_HPP
 #define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_PROXY_TYPE_HPP
 
+#include <boost/preprocessor/dec.hpp>
+#include <boost/preprocessor/control/if.hpp>
+#include <boost/preprocessor/seq/seq.hpp>
 #include <boost/preprocessor/seq/for_each.hpp>
 #include <boost/preprocessor/seq/size.hpp>
 #include <boost/preprocessor/repetition/repeat.hpp>
 
+#define BOOST_FUSION_ADAPT_STRUCT_PROXY_DUMMY4(A,B,C,D)
 #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) }
@@ -20,8 +24,14 @@
 #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) \
+ BOOST_PP_IF( \
+ BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \
+ BOOST_PP_SEQ_FOR_EACH_R, \
+ BOOST_FUSION_ADAPT_STRUCT_PROXY_DUMMY4)( \
+ 1, \
+ BOOST_FUSION_ADAPT_STRUCT_PROXY_TYPE_NS_BEGIN, \
+ _, \
+ BOOST_PP_SEQ_TAIL(NAMESPACE_SEQ)) \
                                                                                 \
     struct NAME \
     { \
@@ -33,12 +43,18 @@
     }; \
                                                                                 \
     BOOST_PP_REPEAT_1( \
- BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ), \
+ BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \
         BOOST_FUSION_ADAPT_STRUCT_PROXY_TYPE_NS_END, \
         _)
 
 #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)
+ BOOST_PP_IF( \
+ BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \
+ BOOST_PP_SEQ_FOR_EACH_R, \
+ BOOST_FUSION_ADAPT_STRUCT_PROXY_DUMMY4)( \
+ 1, \
+ BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION_I, \
+ _, \
+ BOOST_PP_SEQ_TAIL(NAMESPACE_SEQ))
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/size_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/size_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/size_impl.hpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -9,8 +9,6 @@
 #ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_SIZE_IMPL_HPP
 #define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_SIZE_IMPL_HPP
 
-#include <boost/mpl/int.hpp>
-
 namespace boost { namespace fusion { namespace extension
 {
     template<typename>

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/std_pair.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/std_pair.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/std_pair.hpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -1,7 +1,7 @@
 /*=============================================================================
     Copyright (c) 2001-2006 Joel de Guzman
     Copyright (c) 2005-2006 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)
@@ -10,92 +10,15 @@
 #ifndef BOOST_FUSION_ADAPTED_STD_PAIR_HPP
 #define BOOST_FUSION_ADAPTED_STD_PAIR_HPP
 
-#include <boost/config.hpp>
 #include <boost/fusion/adapted/struct/adapt_struct.hpp>
-#include <boost/fusion/support/tag_of_fwd.hpp>
-#include <boost/fusion/support/internal/ref.hpp>
 
-#include <boost/mpl/tag.hpp>
-#include <boost/mpl/int.hpp>
-#include <boost/config/no_tr1/utility.hpp>
-
-namespace boost
+namespace std
 {
- namespace fusion { namespace traits
- {
-#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
-# define BOOST_FUSION_STD_PAIR_TAG_OF_SPECIALIZATION(MODIFIER, _) \
- template <typename T1, typename T2> \
- struct tag_of<std::pair<T1, T2> MODIFIER, void> \
- { \
- typedef struct_tag type; \
- };
-#else
-# define BOOST_FUSION_STD_PAIR_TAG_OF_SPECIALIZATION(MODIFIER, _) \
- template <typename T1, typename T2> \
- struct tag_of<std::pair<T1, T2> MODIFIER> \
- { \
- typedef struct_tag type; \
- };
-#endif
-
- BOOST_FUSION_ALL_CV_REF_NON_REF_COMBINATIONS(
- BOOST_FUSION_STD_PAIR_TAG_OF_SPECIALIZATION,name)
-
-#undef BOOST_FUSION_STD_PAIR_TAG_OF_SPECIALIZATION
- }}
-
- namespace mpl
- {
- template<typename>
- struct sequence_tag;
-
- template <typename T1, typename T2>
- struct sequence_tag<std::pair<T1, T2> >
- {
- typedef fusion::fusion_sequence_tag type;
- };
-
- template <typename T1, typename T2>
- struct sequence_tag<std::pair<T1, T2> const>
- {
- typedef fusion::fusion_sequence_tag type;
- };
- }
-
- namespace fusion { namespace extension
- {
- template <typename T1, typename T2>
- struct struct_member<std::pair<T1, T2>, 0>
- {
- typedef T1 type;
-
- template<typename Pair>
- static typename detail::forward_as<Pair&, type>::type
- call(Pair& pair)
- {
- return pair.first;
- }
- };
-
- template <typename T1, typename T2>
- struct struct_member<std::pair<T1, T2>, 1>
- {
- typedef T2 type;
-
- template<typename Pair>
- static typename detail::forward_as<Pair&, type>::type
- call(Pair& pair)
- {
- return pair.second;
- }
- };
-
- template <typename T1, typename T2>
- struct struct_size<std::pair<T1, T2> >
- : mpl::int_<2>
- {};
- }}
+ template<class T1, class T2>
+ struct pair;
 }
 
+BOOST_FUSION_ADAPT_TPL_STRUCT(
+ (T1)(T2),(std::pair)(T1)(T2),(T1, first)(T2, second))
+
 #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-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -42,7 +42,7 @@
     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_PARAMS_SEQ, NAME_SEQ, I, PREFIX, ATTRIBUTE, 3) \
                                                                                 \
     template< \
         BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \

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-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -20,11 +20,13 @@
 #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_DEFINE_PROXY_TYPE( \
+ WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
                                                                                 \
     BOOST_FUSION_ADAPT_STRUCT_BASE( \
         (0), \
- (0)(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(NAMESPACE_SEQ)NAME),\
+ (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)

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-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -21,11 +21,13 @@
 #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_DEFINE_PROXY_TYPE( \
+ WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \
                                                                                 \
     BOOST_FUSION_ADAPT_STRUCT_BASE( \
         (0), \
- (0)(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(NAMESPACE_SEQ)NAME),\
+ (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)

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience.hpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -8,10 +8,13 @@
 #ifndef BOOST_FUSION_SEQUENCE_CONVENIENCE_HPP
 #define BOOST_FUSION_SEQUENCE_CONVENIENCE_HPP
 
+#include <boost/config.hpp>
 #include <boost/fusion/sequence/convenience/copy.hpp>
 #include <boost/fusion/sequence/convenience/fill.hpp>
 #include <boost/fusion/sequence/convenience/generate.hpp>
-#include <boost/fusion/sequence/convenience/move.hpp>
+#ifndef BOOST_NO_RVALUE_REFERENCES
+# include <boost/fusion/sequence/convenience/move.hpp>
+#endif
 #include <boost/fusion/sequence/convenience/swap.hpp>
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/generate.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/generate.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/generate.hpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -22,7 +22,7 @@
             F f;
 
             generator(F f)
-#ifndef BOOST_NO_RVALUE_REFERENCES
+#ifdef BOOST_NO_RVALUE_REFERENCES
               : f(f)
 #else
               : f(std::move(f))
@@ -59,7 +59,7 @@
     {
         fusion::for_each(
             seq,
- detail::generator<BOOST_FUSION_R_ELSE_OBJ(F)>(
+ detail::generator<BOOST_FUSION_RREF_ELSE_OBJ(F)>(
                 BOOST_FUSION_FORWARD(F,f)));
     }
 }}

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/move.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/move.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/convenience/move.hpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -23,7 +23,7 @@
 {
     namespace detail
     {
- struct move
+ struct mover
         {
             template<class ZippedElements>
             void

Modified: sandbox/SOC/2009/fusion/boost/fusion/support/deduce.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/support/deduce.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/deduce.hpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -78,8 +78,7 @@
             typedef T MODIFIER2(MODIFIER3 type)[N];\
         };
 
- BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(
- BOOST_PP_EMPTY(),BOOST_PP_EMPTY(),&);
+ BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(BOOST_PP_EMPTY(),const,&);
         BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(const,const,&);
         BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(volatile,volatile,&);
         BOOST_FUSION_DEDUCE_ARRAY_SPECIALIZATION(

Modified: sandbox/SOC/2009/fusion/boost/fusion/support/internal/ref.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/support/internal/ref.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/internal/ref.hpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -31,6 +31,10 @@
 # include <boost/type_traits/remove_const.hpp>
 #endif
 
+#ifndef BOOST_NO_RVALUE_REFERENCES
+# include <utility>
+#endif
+
 //cschmidt: We ignore volatile in the BOOST_FUSION_ALL_CV_*-Macros, as we would
 //get a lot of problems with older compilers. On top of that, fusion
 //types are not meant to be volatile anyway.

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/nview/detail/equal_to_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/nview/detail/equal_to_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/nview/detail/equal_to_impl.hpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -9,7 +9,6 @@
 #define BOOST_FUSION_VIEW_NVIEW_DETAIL_EQUAL_TO_IMPL_HPP
 
 #include <boost/mpl/and.hpp>
-#include <boost/mpl/equal_to.hpp>
 #include <boost/type_traits/is_same.hpp>
 
 namespace boost { namespace fusion { namespace extension
@@ -32,7 +31,7 @@
                         typename detail::identity<typename it1::seq_type>::type
                       , typename detail::identity<typename it2::seq_type>::type
>
- , mpl::equal_to<
+ , is_same<
                         typename it1::pos_type
                       , typename it2::pos_type
>

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/nview/detail/nview_iterator.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/nview/detail/nview_iterator.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/nview/detail/nview_iterator.hpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -11,6 +11,7 @@
 
 #include <boost/fusion/support/iterator_base.hpp>
 #include <boost/fusion/support/internal/assert.hpp>
+#include <boost/type_traits/is_same.hpp>
 
 namespace boost { namespace fusion
 {
@@ -32,7 +33,7 @@
         {
             BOOST_FUSION_TAG_CHECK(OtherIt,nview_iterator_tag);
             BOOST_FUSION_MPL_ASSERT((
- mpl::equal_to<
+ is_same<
                     Pos
                   , detail::remove_reference<OtherIt>::type::pos_type
>));
@@ -48,7 +49,7 @@
         {
             BOOST_FUSION_TAG_CHECK(OtherIt,nview_iterator_tag);
             BOOST_FUSION_MPL_ASSERT((
- mpl::equal_to<
+ is_same<
                     Pos
                   , detail::remove_reference<OtherIt>::type::pos_type
>));

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/Jamfile
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/Jamfile (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/Jamfile 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -97,11 +97,18 @@
     [ run sequence/zip_view_ignore.cpp : : : : ]
     [ run sequence/repetitive_view.cpp : : : : ]
     [ run sequence/deduce_sequence.cpp : : : : ]
- [ run sequence/adapt_struct.cpp : : : : ]
+ [ run sequence/adapt_assoc_class_named.cpp : : : : ]
+ [ run sequence/adapt_assoc_class.cpp : : : : ]
+ [ run sequence/adapt_assoc_struct_named.cpp : : : : ]
     [ run sequence/adapt_assoc_struct.cpp : : : : ]
- [ run sequence/adapt_struct_named.cpp : : : : ]
- [ run sequence/adapt_class.cpp : : : : ]
+ [ run sequence/adapt_assoc_tpl_class.cpp : : : : ]
+ [ run sequence/adapt_assoc_tpl_struct.cpp : : : : ]
     [ run sequence/adapt_class_named.cpp : : : : ]
+ [ run sequence/adapt_class.cpp : : : : ]
+ [ run sequence/adapt_struct_named.cpp : : : : ]
+ [ run sequence/adapt_struct.cpp : : : : ]
+ [ run sequence/adapt_tpl_class.cpp : : : : ]
+ [ run sequence/adapt_tpl_struct.cpp : : : : ]
     
     [ run functional/fused.cpp : : : : ]
     [ run functional/fused_function_object.cpp : : : : ]

Added: sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_class.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_class.cpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -0,0 +1,136 @@
+/*=============================================================================
+ Copyright (c) 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)
+==============================================================================*/
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/sequence.hpp>
+#include <boost/fusion/support.hpp>
+#include <boost/fusion/container/list.hpp>
+#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/container/generation/make_vector.hpp>
+#include <boost/fusion/adapted/class/adapt_assoc_class.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/front.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/static_assert.hpp>
+#include <iostream>
+#include <string>
+
+namespace ns
+{
+ struct x_member;
+ struct y_member;
+ struct z_member;
+
+ class point
+ {
+ public:
+
+ point() : x(0), y(0) {}
+ point(int x, int y) : x(x), y(y) {}
+
+ int get_x() const { return x; }
+ int get_y() const { return y; }
+ void set_x(int x_) { x = x_; }
+ void set_y(int y_) { y = y_; }
+
+ private:
+
+ int x;
+ int y;
+ };
+}
+
+BOOST_FUSION_ADAPT_ASSOC_CLASS(
+ ns::point,
+ (int, int, obj.get_x(), obj.set_x(val), ns::x_member)
+ (int, int, obj.get_y(), obj.set_y(val), ns::y_member)
+)
+
+int
+main()
+{
+ using namespace boost::fusion;
+ using namespace std;
+
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+
+ {
+ BOOST_MPL_ASSERT_NOT((traits::is_view<ns::point>));
+ ns::point p(123, 456);
+
+ std::cout << at_c<0>(p) << std::endl;
+ std::cout << at_c<1>(p) << std::endl;
+ std::cout << p << std::endl;
+ BOOST_TEST(p == make_vector(123, 456));
+
+ at_c<0>(p) = 6;
+ at_c<1>(p) = 9;
+ BOOST_TEST(p == make_vector(6, 9));
+
+ BOOST_STATIC_ASSERT(result_of::size<ns::point>::value == 2);
+ BOOST_STATIC_ASSERT(!result_of::empty<ns::point>::value);
+
+ BOOST_TEST(front(p) == 6);
+ BOOST_TEST(back(p) == 9);
+ }
+
+ {
+ boost::fusion::vector<int, float> v1(4, 2);
+ ns::point v2(5, 3);
+ boost::fusion::vector<long, double> v3(5, 4);
+ BOOST_TEST(v1 < v2);
+ BOOST_TEST(v1 <= v2);
+ BOOST_TEST(v2 > v1);
+ BOOST_TEST(v2 >= v1);
+ BOOST_TEST(v2 < v3);
+ BOOST_TEST(v2 <= v3);
+ BOOST_TEST(v3 > v2);
+ BOOST_TEST(v3 >= v2);
+ }
+
+ {
+ // conversion from ns::point to vector
+ ns::point p(5, 3);
+ boost::fusion::vector<int, short> v(p);
+ v = p;
+ }
+
+ {
+ // conversion from ns::point to list
+ ns::point p(5, 3);
+ boost::fusion::list<int, short> l(p);
+ l = p;
+ }
+
+ {
+ BOOST_MPL_ASSERT((boost::mpl::is_sequence<ns::point>));
+ BOOST_MPL_ASSERT((boost::is_same<
+ boost::fusion::result_of::value_at_c<ns::point,0>::type
+ , boost::mpl::front<ns::point>::type>));
+ }
+
+ {
+ // assoc stuff
+ BOOST_MPL_ASSERT((result_of::has_key<ns::point, ns::x_member>));
+ BOOST_MPL_ASSERT((result_of::has_key<ns::point, ns::y_member>));
+ BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<ns::point, ns::z_member> >));
+
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<ns::point, ns::x_member>::type, int>));
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<ns::point, ns::y_member>::type, int>));
+
+ ns::point p(5, 3);
+
+ BOOST_TEST(at_key<ns::x_member>(p) == 5);
+ BOOST_TEST(at_key<ns::y_member>(p) == 3);
+ }
+
+ return boost::report_errors();
+}
+

Added: sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_class_named.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_class_named.cpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -0,0 +1,142 @@
+/*=============================================================================
+ Copyright (c) 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)
+==============================================================================*/
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/sequence.hpp>
+#include <boost/fusion/support.hpp>
+#include <boost/fusion/container/list.hpp>
+#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/container/generation/make_vector.hpp>
+#include <boost/fusion/adapted/class/adapt_assoc_class_named.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/front.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/static_assert.hpp>
+#include <iostream>
+#include <string>
+
+namespace ns
+{
+ struct x_member;
+ struct y_member;
+ struct z_member;
+
+ class point
+ {
+ public:
+
+ point() : x(0), y(0) {}
+ point(int x, int y) : x(x), y(y) {}
+
+ int get_x() const { return x; }
+ int get_y() const { return y; }
+ void set_x(int x_) { x = x_; }
+ void set_y(int y_) { y = y_; }
+
+ private:
+
+ int x;
+ int y;
+ };
+}
+
+BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED(
+ ns::point,
+ point,
+ (int, int, obj.obj.get_x(), obj.obj.set_x(val), ns::x_member)
+ (int, int, obj.obj.get_y(), obj.obj.set_y(val), ns::y_member)
+)
+
+int
+main()
+{
+ using namespace boost::fusion;
+ using namespace std;
+
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+
+ {
+ BOOST_MPL_ASSERT_NOT((traits::is_view<adapted::point>));
+ ns::point basep(123, 456);
+ adapted::point p(basep);
+
+ std::cout << at_c<0>(p) << std::endl;
+ std::cout << at_c<1>(p) << std::endl;
+ std::cout << p << std::endl;
+ BOOST_TEST(p == make_vector(123, 456));
+
+ at_c<0>(p) = 6;
+ at_c<1>(p) = 9;
+ BOOST_TEST(p == make_vector(6, 9));
+
+ BOOST_STATIC_ASSERT(result_of::size<adapted::point>::value == 2);
+ BOOST_STATIC_ASSERT(!result_of::empty<adapted::point>::value);
+
+ BOOST_TEST(front(p) == 6);
+ BOOST_TEST(back(p) == 9);
+ }
+
+ {
+ boost::fusion::vector<int, float> v1(4, 2);
+ ns::point basev2(5, 3);
+ adapted::point v2(basev2);
+ boost::fusion::vector<long, double> v3(5, 4);
+ BOOST_TEST(v1 < v2);
+ BOOST_TEST(v1 <= v2);
+ BOOST_TEST(v2 > v1);
+ BOOST_TEST(v2 >= v1);
+ BOOST_TEST(v2 < v3);
+ BOOST_TEST(v2 <= v3);
+ BOOST_TEST(v3 > v2);
+ BOOST_TEST(v3 >= v2);
+ }
+
+ {
+ // conversion from adapted::point to vector
+ ns::point basep(5, 3);
+ adapted::point p(basep);
+ boost::fusion::vector<int, short> v(p);
+ v = p;
+ }
+
+ {
+ // conversion from adated::point to list
+ ns::point basep(5, 3);
+ adapted::point p(basep);
+ boost::fusion::list<int, short> l(p);
+ l = p;
+ }
+
+ {
+ BOOST_MPL_ASSERT((boost::mpl::is_sequence<adapted::point>));
+ BOOST_MPL_ASSERT((boost::is_same<
+ boost::fusion::result_of::value_at_c<adapted::point,0>::type
+ , boost::mpl::front<adapted::point>::type>));
+ }
+
+ {
+ // assoc stuff
+ BOOST_MPL_ASSERT((result_of::has_key<adapted::point, ns::x_member>));
+ BOOST_MPL_ASSERT((result_of::has_key<adapted::point, ns::y_member>));
+ BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<adapted::point, ns::z_member> >));
+
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<adapted::point, ns::x_member>::type, int>));
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<adapted::point, ns::y_member>::type, int>));
+
+ ns::point basep(5, 3);
+ adapted::point p(basep);
+
+ BOOST_TEST(at_key<ns::x_member>(p) == 5);
+ BOOST_TEST(at_key<ns::y_member>(p) == 3);
+ }
+
+ return boost::report_errors();
+}
+

Added: sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_struct_named.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_struct_named.cpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -0,0 +1,121 @@
+/*=============================================================================
+ Copyright (c) 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)
+==============================================================================*/
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/sequence.hpp>
+#include <boost/fusion/support.hpp>
+#include <boost/fusion/container/list.hpp>
+#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/container/generation/make_vector.hpp>
+#include <boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/static_assert.hpp>
+#include <iostream>
+#include <string>
+
+namespace ns
+{
+ struct x_member;
+ struct y_member;
+ struct z_member;
+
+ struct point
+ {
+ int x;
+ int y;
+ };
+}
+
+BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(
+ ns::point,
+ point,
+ (int, x, ns::x_member)
+ (int, y, ns::y_member)
+)
+
+int
+main()
+{
+ using namespace boost::fusion;
+
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+
+ {
+ BOOST_MPL_ASSERT_NOT((traits::is_view<adapted::point>));
+ ns::point basep = {123, 456};
+ adapted::point p(basep);
+
+ std::cout << at_c<0>(p) << std::endl;
+ std::cout << at_c<1>(p) << std::endl;
+ std::cout << p << std::endl;
+ BOOST_TEST(p == make_vector(123, 456));
+
+ at_c<0>(p) = 6;
+ at_c<1>(p) = 9;
+ BOOST_TEST(p == make_vector(6, 9));
+
+ BOOST_STATIC_ASSERT(result_of::size<adapted::point>::value == 2);
+ BOOST_STATIC_ASSERT(!result_of::empty<adapted::point>::value);
+
+ BOOST_TEST(front(p) == 6);
+ BOOST_TEST(back(p) == 9);
+ }
+
+ {
+ vector<int, float> v1(4, 2);
+ ns::point basev2 = {5, 3};
+ adapted::point v2(basev2);
+
+ vector<long, double> v3(5, 4);
+ BOOST_TEST(v1 < v2);
+ BOOST_TEST(v1 <= v2);
+ BOOST_TEST(v2 > v1);
+ BOOST_TEST(v2 >= v1);
+ BOOST_TEST(v2 < v3);
+ BOOST_TEST(v2 <= v3);
+ BOOST_TEST(v3 > v2);
+ BOOST_TEST(v3 >= v2);
+ }
+
+ {
+ // conversion from adapted::point to vector
+ ns::point basep = {5, 3};
+ adapted::point p(basep);
+ vector<int, short> v(p);
+ v = p;
+ }
+
+ {
+ // conversion from adapted::point to list
+ ns::point basep = {5, 3};
+ adapted::point p(basep);
+ list<int, short> l(p);
+ l = p;
+ }
+
+ {
+ // assoc stuff
+ BOOST_MPL_ASSERT((result_of::has_key<adapted::point, ns::x_member>));
+ BOOST_MPL_ASSERT((result_of::has_key<adapted::point, ns::y_member>));
+ BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<adapted::point, ns::z_member> >));
+
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<adapted::point, ns::x_member>::type, int>));
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<adapted::point, ns::y_member>::type, int>));
+
+ ns::point basep = {5, 3};
+ adapted::point p(basep);
+
+ BOOST_TEST(at_key<ns::x_member>(p) == 5);
+ BOOST_TEST(at_key<ns::y_member>(p) == 3);
+ }
+
+ return boost::report_errors();
+}
+

Added: sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_tpl_class.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_tpl_class.cpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -0,0 +1,140 @@
+/*=============================================================================
+ Copyright (c) 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)
+==============================================================================*/
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/sequence.hpp>
+#include <boost/fusion/support.hpp>
+#include <boost/fusion/container/list.hpp>
+#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/container/generation/make_vector.hpp>
+#include <boost/fusion/adapted/class/adapt_assoc_class.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/mpl/front.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/static_assert.hpp>
+#include <iostream>
+#include <string>
+
+namespace ns
+{
+ struct x_member;
+ struct y_member;
+ struct z_member;
+
+ template<typename X, typename Y>
+ class point
+ {
+ public:
+
+ point() : x(0), y(0) {}
+ point(X x, Y y) : x(x), y(y) {}
+
+ X get_x() const { return x; }
+ Y get_y() const { return y; }
+ void set_x(X x_) { x = x_; }
+ void set_y(Y y_) { y = y_; }
+
+ private:
+
+ X x;
+ Y y;
+ };
+}
+
+BOOST_FUSION_ADAPT_ASSOC_TPL_CLASS(
+ (X)(Y),
+ (ns::point)(X)(Y),
+ (X, X, obj.get_x(), obj.set_x(val), ns::x_member)
+ (Y, Y, obj.get_y(), obj.set_y(val), ns::y_member)
+)
+
+int
+main()
+{
+ using namespace boost::fusion;
+ using namespace std;
+
+ typedef ns::point<int,int> point;
+
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+
+ {
+ BOOST_MPL_ASSERT_NOT((traits::is_view<point>));
+ point p(123, 456);
+
+ std::cout << at_c<0>(p) << std::endl;
+ std::cout << at_c<1>(p) << std::endl;
+ std::cout << p << std::endl;
+ BOOST_TEST(p == make_vector(123, 456));
+
+ at_c<0>(p) = 6;
+ at_c<1>(p) = 9;
+ BOOST_TEST(p == make_vector(6, 9));
+
+ BOOST_STATIC_ASSERT(result_of::size<point>::value == 2);
+ BOOST_STATIC_ASSERT(!result_of::empty<point>::value);
+
+ BOOST_TEST(front(p) == 6);
+ BOOST_TEST(back(p) == 9);
+ }
+
+ {
+ boost::fusion::vector<int, float> v1(4, 2);
+ point v2(5, 3);
+ boost::fusion::vector<long, double> v3(5, 4);
+ BOOST_TEST(v1 < v2);
+ BOOST_TEST(v1 <= v2);
+ BOOST_TEST(v2 > v1);
+ BOOST_TEST(v2 >= v1);
+ BOOST_TEST(v2 < v3);
+ BOOST_TEST(v2 <= v3);
+ BOOST_TEST(v3 > v2);
+ BOOST_TEST(v3 >= v2);
+ }
+
+ {
+ // conversion from point to vector
+ point p(5, 3);
+ boost::fusion::vector<int, short> v(p);
+ v = p;
+ }
+
+ {
+ // conversion from point to list
+ point p(5, 3);
+ boost::fusion::list<int, short> l(p);
+ l = p;
+ }
+
+ {
+ BOOST_MPL_ASSERT((boost::mpl::is_sequence<point>));
+ BOOST_MPL_ASSERT((boost::is_same<
+ boost::fusion::result_of::value_at_c<point,0>::type
+ , boost::mpl::front<point>::type>));
+ }
+
+ {
+ // assoc stuff
+ BOOST_MPL_ASSERT((result_of::has_key<point, ns::x_member>));
+ BOOST_MPL_ASSERT((result_of::has_key<point, ns::y_member>));
+ BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<point, ns::z_member> >));
+
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<point, ns::x_member>::type, int>));
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<point, ns::y_member>::type, int>));
+
+ point p(5, 3);
+
+ BOOST_TEST(at_key<ns::x_member>(p) == 5);
+ BOOST_TEST(at_key<ns::y_member>(p) == 3);
+ }
+
+ return boost::report_errors();
+}
+

Added: sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_tpl_struct.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_assoc_tpl_struct.cpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -0,0 +1,133 @@
+/*=============================================================================
+ Copyright (c) 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)
+==============================================================================*/
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
+#include <boost/fusion/sequence/intrinsic/at.hpp>
+#include <boost/fusion/sequence/intrinsic/size.hpp>
+#include <boost/fusion/sequence/intrinsic/empty.hpp>
+#include <boost/fusion/sequence/intrinsic/front.hpp>
+#include <boost/fusion/sequence/intrinsic/back.hpp>
+#include <boost/fusion/sequence/intrinsic/has_key.hpp>
+#include <boost/fusion/sequence/intrinsic/at_key.hpp>
+#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
+#include <boost/fusion/sequence/io/out.hpp>
+#include <boost/fusion/container/vector/vector.hpp>
+#include <boost/fusion/container/list/list.hpp>
+#include <boost/fusion/container/generation/make_vector.hpp>
+#include <boost/fusion/container/vector/convert.hpp>
+#include <boost/fusion/sequence/comparison/equal_to.hpp>
+#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
+#include <boost/fusion/sequence/comparison/less.hpp>
+#include <boost/fusion/sequence/comparison/less_equal.hpp>
+#include <boost/fusion/sequence/comparison/greater.hpp>
+#include <boost/fusion/sequence/comparison/greater_equal.hpp>
+#include <boost/fusion/support/is_view.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/not.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/static_assert.hpp>
+#include <iostream>
+#include <string>
+
+namespace ns
+{
+ struct x_member;
+ struct y_member;
+ struct z_member;
+
+ template<typename X, typename Y>
+ struct point
+ {
+ X x;
+ Y y;
+ };
+}
+
+BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT(
+ (X)(Y),
+ (ns::point)(X)(Y),
+ (int, x, ns::x_member)
+ (int, y, ns::y_member)
+)
+
+int
+main()
+{
+ using namespace boost::fusion;
+
+ typedef ns::point<int,int> point;
+
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+
+ {
+ BOOST_MPL_ASSERT_NOT((traits::is_view<point>));
+ point p = {123, 456};
+
+ std::cout << at_c<0>(p) << std::endl;
+ std::cout << at_c<1>(p) << std::endl;
+ std::cout << p << std::endl;
+ BOOST_TEST(p == make_vector(123, 456));
+
+ at_c<0>(p) = 6;
+ at_c<1>(p) = 9;
+ BOOST_TEST(p == make_vector(6, 9));
+
+ BOOST_STATIC_ASSERT(result_of::size<point>::value == 2);
+ BOOST_STATIC_ASSERT(!result_of::empty<point>::value);
+
+ BOOST_TEST(front(p) == 6);
+ BOOST_TEST(back(p) == 9);
+ }
+
+ {
+ vector<int, float> v1(4, 2);
+ point v2 = {5, 3};
+ vector<long, double> v3(5, 4);
+ BOOST_TEST(v1 < v2);
+ BOOST_TEST(v1 <= v2);
+ BOOST_TEST(v2 > v1);
+ BOOST_TEST(v2 >= v1);
+ BOOST_TEST(v2 < v3);
+ BOOST_TEST(v2 <= v3);
+ BOOST_TEST(v3 > v2);
+ BOOST_TEST(v3 >= v2);
+ }
+
+ {
+ // conversion from point to vector
+ point p = {5, 3};
+ vector<int, short> v(p);
+ v = p;
+ }
+
+ {
+ // conversion from point to list
+ point p = {5, 3};
+ list<int, short> l(p);
+ l = p;
+ }
+
+ {
+ // assoc stuff
+ BOOST_MPL_ASSERT((result_of::has_key<point, ns::x_member>));
+ BOOST_MPL_ASSERT((result_of::has_key<point, ns::y_member>));
+ BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<point, ns::z_member> >));
+
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<point, ns::x_member>::type, int>));
+ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<point, ns::y_member>::type, int>));
+
+ point p = {5, 3};
+
+ BOOST_TEST(at_key<ns::x_member>(p) == 5);
+ BOOST_TEST(at_key<ns::y_member>(p) == 3);
+ }
+
+ return boost::report_errors();
+}
+

Added: sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_tpl_class.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_tpl_class.cpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -0,0 +1,133 @@
+/*=============================================================================
+ Copyright (c) 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)
+==============================================================================*/
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/adapted/class/adapt_class.hpp>
+#include <boost/fusion/sequence/intrinsic/at.hpp>
+#include <boost/fusion/sequence/intrinsic/size.hpp>
+#include <boost/fusion/sequence/intrinsic/empty.hpp>
+#include <boost/fusion/sequence/intrinsic/front.hpp>
+#include <boost/fusion/sequence/intrinsic/back.hpp>
+#include <boost/fusion/sequence/intrinsic/value_at.hpp>
+#include <boost/fusion/sequence/io/out.hpp>
+#include <boost/fusion/container/vector/vector.hpp>
+#include <boost/fusion/container/list/list.hpp>
+#include <boost/fusion/container/generation/make_vector.hpp>
+#include <boost/fusion/container/vector/convert.hpp>
+#include <boost/fusion/sequence/comparison/equal_to.hpp>
+#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
+#include <boost/fusion/sequence/comparison/less.hpp>
+#include <boost/fusion/sequence/comparison/less_equal.hpp>
+#include <boost/fusion/sequence/comparison/greater.hpp>
+#include <boost/fusion/sequence/comparison/greater_equal.hpp>
+#include <boost/fusion/mpl.hpp>
+#include <boost/fusion/support/is_view.hpp>
+#include <boost/mpl/front.hpp>
+#include <boost/mpl/is_sequence.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <iostream>
+#include <string>
+
+namespace ns
+{
+ template<typename X, typename Y>
+ class point
+ {
+ public:
+
+ point() : x(0), y(0) {}
+ point(X x, Y y) : x(x), y(y) {}
+
+ X get_x() const { return x; }
+ Y get_y() const { return y; }
+ void set_x(X x_) { x = x_; }
+ void set_y(Y y_) { y = y_; }
+
+ private:
+
+ X x;
+ Y y;
+ };
+}
+
+BOOST_FUSION_ADAPT_TPL_CLASS(
+ (X)(Y),
+ (ns::point)(X)(Y),
+ (X, X, obj.get_x(), obj.set_x(val))
+ (Y, Y, obj.get_y(), obj.set_y(val))
+)
+
+int
+main()
+{
+ using namespace boost::fusion;
+ using namespace std;
+
+ typedef ns::point<int, int> point;
+
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+
+ {
+ BOOST_MPL_ASSERT_NOT((traits::is_view<point>));
+ point p(123, 456);
+
+ std::cout << at_c<0>(p) << std::endl;
+ std::cout << at_c<1>(p) << std::endl;
+ std::cout << p << std::endl;
+ BOOST_TEST(p == make_vector(123, 456));
+
+ at_c<0>(p) = 6;
+ at_c<1>(p) = 9;
+ BOOST_TEST(p == make_vector(6, 9));
+
+ BOOST_STATIC_ASSERT(result_of::size<point>::value == 2);
+ BOOST_STATIC_ASSERT(!result_of::empty<point>::value);
+
+ BOOST_TEST(front(p) == 6);
+ BOOST_TEST(back(p) == 9);
+ }
+
+ {
+ boost::fusion::vector<int, float> v1(4, 2);
+ point v2(5, 3);
+ boost::fusion::vector<long, double> v3(5, 4);
+ BOOST_TEST(v1 < v2);
+ BOOST_TEST(v1 <= v2);
+ BOOST_TEST(v2 > v1);
+ BOOST_TEST(v2 >= v1);
+ BOOST_TEST(v2 < v3);
+ BOOST_TEST(v2 <= v3);
+ BOOST_TEST(v3 > v2);
+ BOOST_TEST(v3 >= v2);
+ }
+
+ {
+ // conversion from point to vector
+ point p(5, 3);
+ boost::fusion::vector<int, short> v(p);
+ v = p;
+ }
+
+ {
+ // conversion from point to list
+ point p(5, 3);
+ boost::fusion::list<int, short> l(p);
+ l = p;
+ }
+
+ {
+ BOOST_MPL_ASSERT((boost::mpl::is_sequence<point>));
+ BOOST_MPL_ASSERT((boost::is_same<
+ boost::fusion::result_of::value_at_c<point,0>::type
+ , boost::mpl::front<point>::type>));
+ }
+
+ return boost::report_errors();
+}
+

Added: sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_tpl_struct.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/sequence/adapt_tpl_struct.cpp 2010-02-22 17:52:42 EST (Mon, 22 Feb 2010)
@@ -0,0 +1,122 @@
+/*=============================================================================
+ Copyright (c) 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)
+==============================================================================*/
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/fusion/adapted/struct/adapt_struct.hpp>
+#include <boost/fusion/sequence/intrinsic/at.hpp>
+#include <boost/fusion/sequence/intrinsic/size.hpp>
+#include <boost/fusion/sequence/intrinsic/empty.hpp>
+#include <boost/fusion/sequence/intrinsic/front.hpp>
+#include <boost/fusion/sequence/intrinsic/back.hpp>
+#include <boost/fusion/sequence/io/out.hpp>
+#include <boost/fusion/container/vector/vector.hpp>
+#include <boost/fusion/container/list/list.hpp>
+#include <boost/fusion/container/generation/make_vector.hpp>
+#include <boost/fusion/container/vector/convert.hpp>
+#include <boost/fusion/sequence/comparison/equal_to.hpp>
+#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
+#include <boost/fusion/sequence/comparison/less.hpp>
+#include <boost/fusion/sequence/comparison/less_equal.hpp>
+#include <boost/fusion/sequence/comparison/greater.hpp>
+#include <boost/fusion/sequence/comparison/greater_equal.hpp>
+#include <boost/fusion/support/is_view.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <iostream>
+#include <string>
+
+namespace ns
+{
+ template<typename X, typename Y>
+ struct point
+ {
+ X x;
+ Y y;
+ };
+}
+
+BOOST_FUSION_ADAPT_TPL_STRUCT(
+ (X)(Y),
+ (ns::point)(X)(Y),
+ (X, x)
+ (Y, y)
+)
+
+template<typename M>
+struct s { M m; };
+BOOST_FUSION_ADAPT_TPL_STRUCT((M), (s)(M), (M, m))
+
+int
+main()
+{
+ using namespace boost::fusion;
+
+ typedef ns::point<int, int> point;
+
+ std::cout << tuple_open('[');
+ std::cout << tuple_close(']');
+ std::cout << tuple_delimiter(", ");
+
+ {
+ BOOST_MPL_ASSERT_NOT((traits::is_view<point>));
+ point p = {123, 456};
+
+ std::cout << at_c<0>(p) << std::endl;
+ std::cout << at_c<1>(p) << std::endl;
+ std::cout << p << std::endl;
+ BOOST_TEST(p == make_vector(123, 456));
+
+ at_c<0>(p) = 6;
+ at_c<1>(p) = 9;
+ BOOST_TEST(p == make_vector(6, 9));
+
+ BOOST_STATIC_ASSERT(result_of::size<point>::value == 2);
+ BOOST_STATIC_ASSERT(!result_of::empty<point>::value);
+
+ BOOST_TEST(front(p) == 6);
+ BOOST_TEST(back(p) == 9);
+ }
+
+ {
+ vector<int, float> v1(4, 2);
+ point v2 = {5, 3};
+ vector<long, double> v3(5, 4);
+ BOOST_TEST(v1 < v2);
+ BOOST_TEST(v1 <= v2);
+ BOOST_TEST(v2 > v1);
+ BOOST_TEST(v2 >= v1);
+ BOOST_TEST(v2 < v3);
+ BOOST_TEST(v2 <= v3);
+ BOOST_TEST(v3 > v2);
+ BOOST_TEST(v3 >= v2);
+ }
+
+ {
+ // conversion from point to vector
+ point p = {5, 3};
+ vector<int, short> v(p);
+ v = p;
+ }
+
+ {
+ // conversion from point to list
+ point p = {5, 3};
+ list<int, short> l(p);
+ l = p;
+ }
+
+ { // begin/end
+ using namespace boost::fusion;
+
+ typedef result_of::begin<s<int> >::type b;
+ typedef result_of::end<s<int> >::type e;
+ // this fails
+ BOOST_MPL_ASSERT((boost::is_same<result_of::next<b>::type, e>));
+ }
+
+ return boost::report_errors();
+}
+


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