Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54865 - in sandbox/SOC/2009/fusion: boost/fusion boost/fusion/adapted boost/fusion/adapted/detail/array boost/fusion/adapted/detail/boost_tuple boost/fusion/adapted/detail/std_pair boost/fusion/adapted/detail/struct boost/fusion/container boost/fusion/support boost/fusion/tuple boost/fusion/view/single_view libs/fusion/test libs/fusion/test/sequence
From: mr.chr.schmidt_at_[hidden]
Date: 2009-07-10 13:33:23


Author: cschmidt
Date: 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
New Revision: 54865
URL: http://svn.boost.org/trac/boost/changeset/54865

Log:
bug-fixes
Removed:
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/std_pair/
Text files modified:
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/array/tag_of.hpp | 8 ----
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/boost_tuple/tag_of.hpp | 8 ----
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_base.hpp | 21 +++++++++---
   sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_struct.hpp | 8 -----
   sandbox/SOC/2009/fusion/boost/fusion/adapted/std_pair.hpp | 61 ++++++++++++++++++++-------------------
   sandbox/SOC/2009/fusion/boost/fusion/container/generation.hpp | 3 +
   sandbox/SOC/2009/fusion/boost/fusion/support/ref.hpp | 8 +++++
   sandbox/SOC/2009/fusion/boost/fusion/tuple.hpp | 3 +
   sandbox/SOC/2009/fusion/boost/fusion/tuple/tuple.hpp | 10 ++---
   sandbox/SOC/2009/fusion/boost/fusion/tuple/tuple_tie.hpp | 2 +
   sandbox/SOC/2009/fusion/boost/fusion/view/single_view/single_view_iterator.hpp | 8 ++--
   sandbox/SOC/2009/fusion/libs/fusion/test/Jamfile | 18 +++++-----
   sandbox/SOC/2009/fusion/libs/fusion/test/sequence/std_pair.cpp | 7 +++-
   sandbox/SOC/2009/fusion/libs/fusion/test/sequence/tr1_tuple_auto_conv.cpp | 4 +
   14 files changed, 89 insertions(+), 80 deletions(-)

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/array/tag_of.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/array/tag_of.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/array/tag_of.hpp 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -11,8 +11,6 @@
 
 #include <boost/fusion/support/tag_of_fwd.hpp>
 
-#include <boost/preprocessor/facilities/empty.hpp>
-
 #include <cstddef>
 
 namespace boost
@@ -34,11 +32,7 @@
             typedef array_tag type;\
         };
 
- TAG_OF_SPECIALIZATION(BOOST_PP_EMPTY(),_);
- TAG_OF_SPECIALIZATION(const,_);
- TAG_OF_SPECIALIZATION(const volatile,_);
- TAG_OF_SPECIALIZATION(volatile,_);
- BOOST_FUSION_ALL_CV_REF_COMBINATIONS(TAG_OF_SPECIALIZATION,_)
+ BOOST_FUSION_ALL_CV_REF_NON_REF_COMBINATIONS(TAG_OF_SPECIALIZATION,_)
 
 #undef TAG_OF_SPECIALIZATION
     }

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/boost_tuple/tag_of.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/boost_tuple/tag_of.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/boost_tuple/tag_of.hpp 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -10,8 +10,6 @@
 
 #include <boost/fusion/support/tag_of_fwd.hpp>
 
-#include <boost/preprocessor/facilities/empty.hpp>
-
 namespace boost { namespace fusion
 {
     struct boost_tuple_tag;
@@ -42,11 +40,7 @@
             typedef boost_tuple_tag type;\
         };
 
- TAG_OF_SPECIALIZATION(BOOST_PP_EMPTY(),_);
- TAG_OF_SPECIALIZATION(const,_);
- TAG_OF_SPECIALIZATION(const volatile,_);
- TAG_OF_SPECIALIZATION(volatile,_);
- BOOST_FUSION_ALL_CV_REF_COMBINATIONS(TAG_OF_SPECIALIZATION,_)
+ BOOST_FUSION_ALL_CV_REF_NON_REF_COMBINATIONS(TAG_OF_SPECIALIZATION,_)
 
 #undef TAG_OF_SPECIALIZATION
     }

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 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -5,18 +5,27 @@
 
 #include <boost/fusion/support/tag_of_fwd.hpp>
 
+#include <boost/preprocessor/control/expr_if.hpp>
+#include <boost/preprocessor/array/elem.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/facilities/expand.hpp>
+
 #ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_ADAPT_BASE_HPP
 #define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_ADAPT_BASE_HPP
 
+#define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION(COMBINATION, name) \
+ template <> \
+ struct tag_of<name COMBINATION> \
+ { \
+ typedef struct_tag type; \
+ };
+
+
 #define BOOST_FUSION_ADAPT_STRUCT_BASE(name, seq) \
 namespace boost { namespace fusion { namespace traits \
 { \
- BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION(BOOST_PP_EMPTY(),name); \
- BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION(const,name); \
- BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION(const volatile,name); \
- BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION(volatile,name); \
- BOOST_FUSION_ALL_CV_REF_COMBINATIONS( \
- BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION,name) \
+ BOOST_FUSION_ALL_CV_REF_NON_REF_COMBINATIONS( \
+ BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION,name) \
 }}} \
                                                                                 \
 namespace boost { namespace fusion { namespace extension \

Modified: sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_struct.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_struct.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/adapted/detail/struct/adapt_struct.hpp 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -30,14 +30,6 @@
 // BOOST_FUSION_ADAPT_STRUCT_I generates the overarching structure and uses
 // SEQ_FOR_EACH_I to generate the "linear" substructures.
 // Thanks to Paul Mensonides for the PP macro help
-
-#define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION(COMBINATION, name) \
- template <> \
- struct tag_of<name COMBINATION> \
- { \
- typedef struct_tag type; \
- }; \
-
 #define BOOST_FUSION_ADAPT_STRUCT_I(name, seq) \
     BOOST_FUSION_ADAPT_STRUCT_BASE(name, seq) \
     BOOST_PP_SEQ_FOR_EACH_I(BOOST_FUSION_ADAPT_STRUCT_C, name, seq)

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 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -9,45 +9,42 @@
 #ifndef BOOST_FUSION_ADAPTED_STD_PAIR_HPP
 #define BOOST_FUSION_ADAPTED_STD_PAIR_HPP
 
-#include <boost/fusion/support/ref.hpp>
-
-#include <boost/fusion/support/tag_of_fwd.hpp>
 #include <boost/fusion/adapted/struct.hpp>
 
 #include <boost/mpl/int.hpp>
 #include <boost/config/no_tr1/utility.hpp>
 
-namespace boost { namespace fusion
-{
- struct struct_tag;
+#define BOOST_FUSION_STD_PAIR_TAG_OF_SPECIALIZATION(COMBINATION, _) \
+ template <typename T1, typename T2> \
+ struct tag_of<std::pair<T1, T2> COMBINATION> \
+ { \
+ typedef struct_tag type; \
+ };
+
+namespace boost { namespace fusion { namespace traits \
+{ \
+ BOOST_FUSION_ALL_CV_REF_NON_REF_COMBINATIONS( \
+ BOOST_FUSION_STD_PAIR_TAG_OF_SPECIALIZATION,name) \
+}}} \
 
- namespace traits
- {
- template <typename T1, typename T2>
-#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
- struct tag_of<std::pair<T1, T2>, void >
-#else
- struct tag_of<std::pair<T1, T2> >
-#endif
- {
- typedef struct_tag type;
- };
- }
+#undef BOOST_FUSION_STD_PAIR_TAG_OF_SPECIALIZATION
 
+namespace boost { namespace fusion
+{
     namespace extension
     {
- template <typename Struct, int N>
- struct struct_member;
-
- template <typename Struct>
- struct struct_size;
-
         template <typename T1, typename T2>
         struct struct_member<std::pair<T1, T2>, 0>
         {
             typedef T1 type;
 
- static type& call(std::pair<T1, T2>& pair)
+ template<typename Pair>
+ static typename
+ detail::result_of_forward_as<
+ BOOST_FUSION_R_ELSE_LREF(Pair)
+ , type
+ >::type
+ call(BOOST_FUSION_R_ELSE_LREF(Pair) pair)
             {
                 return pair.first;
             }
@@ -58,16 +55,22 @@
         {
             typedef T2 type;
 
- static type& call(std::pair<T1, T2>& pair)
+ template<typename Pair>
+ static typename
+ detail::result_of_forward_as<
+ BOOST_FUSION_R_ELSE_LREF(Pair)
+ , type
+ >::type
+ call(BOOST_FUSION_R_ELSE_LREF(Pair) pair)
             {
                 return pair.second;
             }
         };
 
         template <typename T1, typename T2>
- struct struct_size<std::pair<T1, T2> > : mpl::int_<2>
- {
- };
+ struct struct_size<std::pair<T1, T2> >
+ : mpl::int_<2>
+ {};
     }
 }}
 

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/generation.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/generation.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/generation.hpp 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -8,8 +8,9 @@
 #ifndef BOOST_FUSION_CONTAINER_GENERATION_HPP
 #define BOOST_FUSION_CONTAINER_GENERATION_HPP
 
-#include <boost/fusion/container/generation/cons_tie.hpp>
+//TODO move ignore.hpp in the _tie-headers?
 #include <boost/fusion/container/generation/ignore.hpp>
+#include <boost/fusion/container/generation/cons_tie.hpp>
 #include <boost/fusion/container/generation/list_tie.hpp>
 #include <boost/fusion/container/generation/make_cons.hpp>
 #include <boost/fusion/container/generation/make_list.hpp>

Modified: sandbox/SOC/2009/fusion/boost/fusion/support/ref.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/support/ref.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/ref.hpp 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -8,6 +8,8 @@
 
 #include <boost/config.hpp>
 
+#include <boost/preprocessor/empty.hpp>
+
 #include <boost/mpl/eval_if.hpp>
 #ifndef BOOST_NO_RVALUE_REFERENCES
 # include <boost/mpl/or.hpp>
@@ -67,6 +69,12 @@
         MACRO(volatile&&,ARG)\
         MACRO(const volatile&&,ARG)
 #endif
+#define BOOST_FUSION_ALL_CV_REF_NON_REF_COMBINATIONS(MACRO,ARG)\
+ BOOST_FUSION_ALL_CV_REF_COMBINATIONS(MACRO,ARG)\
+ MACRO(BOOST_PP_EMPTY(),ARG)\
+ MACRO(const,ARG)\
+ MACRO(volatile,ARG)\
+ MACRO(const volatile,ARG)
 
 namespace boost { namespace fusion { namespace detail
 {

Modified: sandbox/SOC/2009/fusion/boost/fusion/tuple.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/tuple.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/tuple.hpp 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -8,5 +8,8 @@
 #ifndef BOOST_FUSION_TUPLE_HPP
 #define BOOST_FUSION_TUPLE_HPP
 
+#include <boost/fusion/tuple/tuple_fwd.hpp>
 #include <boost/fusion/tuple/tuple.hpp>
+#include <boost/fusion/tuple/make_tuple.hpp>
+#include <boost/fusion/tuple/tuple_tie.hpp>
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/tuple/tuple.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/tuple/tuple.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/tuple/tuple.hpp 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -18,8 +18,6 @@
 #include <boost/fusion/adapted/std_pair.hpp>
 #include <boost/fusion/support/ref.hpp>
 
-#include <boost/type_traits/is_const.hpp>
-
 namespace boost { namespace fusion
 {
     VARIADIC_TEMPLATE_WITH_DEFAULT(FUSION_MAX_VECTOR_SIZE)
@@ -33,13 +31,13 @@
 
 #define TUPLE_CTOR(COMBINATION,_)\
         tuple(tuple COMBINATION other_tuple)\
- : base_type(BOOST_FUSION_FORWARD(tuple COMBINATION,other_tuple).data)\
+ : base_type(static_cast<base_type COMBINATION>(other_tuple))\
         {}\
         \
- template <typename U1, typename U2>\
- tuple(std::pair<U1, U2> COMBINATION rhs)\
+ template <typename T1, typename T2>\
+ tuple(std::pair<T1, T2> COMBINATION rhs)\
           : base_type(sequence_assign(\
- static_cast<std::pair<U1, U2> COMBINATION>(rhs)))\
+ static_cast<std::pair<T1, T2> COMBINATION>(rhs)))\
         {}
 
         BOOST_FUSION_ALL_CV_REF_COMBINATIONS(TUPLE_CTOR,_)

Modified: sandbox/SOC/2009/fusion/boost/fusion/tuple/tuple_tie.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/tuple/tuple_tie.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/tuple/tuple_tie.hpp 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -7,6 +7,8 @@
 #define BOOST_FUSION_TUPLE_TUPLE_TIE_HPP
 
 #include <boost/config.hpp>
+#include <boost/fusion/container/generation/ignore.hpp>
+
 #ifdef BOOST_NO_VARIADIC_TEMPLATES
 # include <boost/fusion/tuple/detail/pp/tuple_tie.hpp>
 #else

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/single_view/single_view_iterator.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/single_view/single_view_iterator.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/single_view/single_view_iterator.hpp 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -51,8 +51,8 @@
>::type
         value_type;
 
- template<typename OtherSingleViewIt>
- single_view_iterator(BOOST_FUSION_R_ELSE_CLREF(OtherSingleViewIt) it)
+ template<typename OtherIt>
+ single_view_iterator(BOOST_FUSION_R_ELSE_CLREF(OtherIt) it)
           : view(it.view)
         {}
 
@@ -60,9 +60,9 @@
           : view(&view)
         {}
 
- template<typename OtherSingleViewIt>
+ template<typename OtherIt>
         single_view_iterator&
- operator=(BOOST_FUSION_R_ELSE_CLREF(OtherSingleViewIt) it)
+ operator=(BOOST_FUSION_R_ELSE_CLREF(OtherIt) it)
         {
             view=it.view;
             return *this;

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 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -71,16 +71,16 @@
     [ run sequence/single_view.cpp : : : : ]
     [ run sequence/std_pair.cpp : : : : ]
     [ run sequence/swap.cpp : : : : ]
-# [ run sequence/tr1_tuple_auto_conv.cpp : : : : ]
+ [ run sequence/tr1_tuple_auto_conv.cpp : : : : ]
     [ run sequence/transform_view.cpp : : : : ]
-# [ run sequence/tuple_comparison.cpp : : : : ]
-# [ run sequence/tuple_construction.cpp : : : : ]
-# [ run sequence/tuple_copy.cpp : : : : ]
-# [ run sequence/tuple_element.cpp : : : : ]
-# [ run sequence/tuple_make.cpp : : : : ]
-# [ run sequence/tuple_misc.cpp : : : : ]
-# [ run sequence/tuple_mutate.cpp : : : : ]
-# [ run sequence/tuple_tie.cpp : : : : ]
+ [ run sequence/tuple_comparison.cpp : : : : ]
+ [ run sequence/tuple_construction.cpp : : : : ]
+ [ run sequence/tuple_copy.cpp : : : : ]
+ [ run sequence/tuple_element.cpp : : : : ]
+ [ run sequence/tuple_make.cpp : : : : ]
+ [ run sequence/tuple_misc.cpp : : : : ]
+ [ run sequence/tuple_mutate.cpp : : : : ]
+ [ run sequence/tuple_tie.cpp : : : : ]
     [ run sequence/vector_comparison.cpp : : : : ]
     [ run sequence/vector_construction.cpp : : : : ]
     [ run sequence/vector_copy.cpp : : : : ]

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/sequence/std_pair.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/sequence/std_pair.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/sequence/std_pair.cpp 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -23,7 +23,10 @@
 #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>
 #include <utility>
@@ -76,13 +79,13 @@
 
     {
         // conversion from pair to vector
- fusion::vector<int, std::string> v(std::make_pair(123, "Hola!!!"));
+ fusion::vector<int, std::string> v(sequence_assign(std::make_pair(123, "Hola!!!")));
         v = std::make_pair(123, "Hola!!!");
     }
 
     {
         // conversion from pair to list
- fusion::list<int, std::string> l(std::make_pair(123, "Hola!!!"));
+ fusion::list<int, std::string> l(sequence_assign(std::make_pair(123, "Hola!!!")));
         l = std::make_pair(123, "Hola!!!");
     }
 

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/sequence/tr1_tuple_auto_conv.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/sequence/tr1_tuple_auto_conv.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/sequence/tr1_tuple_auto_conv.cpp 2009-07-10 13:33:20 EDT (Fri, 10 Jul 2009)
@@ -11,6 +11,8 @@
 #include <boost/any.hpp>
 #include <iostream>
 
+//TODO cschmidt: In C++0x this won't work any more?!
+
 namespace Core
 {
     class AutoConverter
@@ -56,7 +58,7 @@
 
 int main(int argc, char* argv[])
 {
- std::tr1::tuple<int, int, int, int> test = Core::Demo();
+ //std::tr1::tuple<int, int, int, int> test = Core::Demo();
     return 0;
 }
 


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