Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54686 - in sandbox/SOC/2009/fusion: boost/fusion/algorithm/iteration/detail boost/fusion/algorithm/query/detail boost/fusion/algorithm/transformation boost/fusion/algorithm/transformation/detail boost/fusion/algorithm/transformation/detail/pp boost/fusion/algorithm/transformation/detail/variadic_templates boost/fusion/container/vector/detail/variadic_templates boost/fusion/sequence/intrinsic boost/fusion/support boost/fusion/view/transform_view/detail boost/fusion/view/zip_view libs/fusion/example/test libs/fusion/test libs/fusion/test/algorithm libs/fusion/test/sequence
From: mr.chr.schmidt_at_[hidden]
Date: 2009-07-05 17:22:41


Author: cschmidt
Date: 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
New Revision: 54686
URL: http://svn.boost.org/trac/boost/changeset/54686

Log:
cleanup (3)
Added:
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/detail/pp/
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/detail/pp/zip.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/detail/variadic_templates/
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/detail/variadic_templates/zip.hpp (contents, props changed)
   sandbox/SOC/2009/fusion/boost/fusion/support/result_of.hpp (contents, props changed)
Text files modified:
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/fold.hpp | 20 ++++------
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/for_each.hpp | 2
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/query/detail/any.hpp | 4 +-
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/detail/replace_if.hpp | 23 +++++++----
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/replace_if.hpp | 29 +++++---------
   sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/zip.hpp | 75 +++------------------------------------
   sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector_impl.hpp | 15 ++-----
   sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector_n.hpp | 33 ++++++++++-------
   sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/swap.hpp | 6 --
   sandbox/SOC/2009/fusion/boost/fusion/support/tag_of.hpp | 1
   sandbox/SOC/2009/fusion/boost/fusion/view/transform_view/detail/apply_transform_result.hpp | 11 +----
   sandbox/SOC/2009/fusion/boost/fusion/view/zip_view/zip_view.hpp | 2
   sandbox/SOC/2009/fusion/libs/fusion/example/test/main.cpp | 2
   sandbox/SOC/2009/fusion/libs/fusion/test/Jamfile | 8 ++--
   sandbox/SOC/2009/fusion/libs/fusion/test/algorithm/fold.cpp | 18 ++------
   sandbox/SOC/2009/fusion/libs/fusion/test/sequence/cons.cpp | 18 +++-----
   16 files changed, 90 insertions(+), 177 deletions(-)

Modified: sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/fold.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/fold.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/fold.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -17,6 +17,7 @@
 #include <boost/fusion/iterator/value_of.hpp>
 #include <boost/fusion/iterator/next.hpp>
 #include <boost/fusion/iterator/distance.hpp>
+#include <boost/fusion/support/result_of.hpp>
 
 #include <boost/mpl/bool.hpp>
 #include <boost/mpl/apply.hpp>
@@ -34,18 +35,13 @@
     {
         template <typename It, typename State, typename F>
         struct fold_apply
- {
- typedef typename identity<F>::type identity_F;
-
- typedef typename
- identity_F::template result<
- identity_F(
- typename result_of::deref<It>::type
- , State
- )
- >::type
- type;
- };
+ : support::result_of<
+ F(
+ typename result_of::deref<It>::type
+ , State
+ )
+ >
+ {};
 
         template <typename First, typename Last, typename State, typename F>
         struct static_fold;

Modified: sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/for_each.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/for_each.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/iteration/detail/for_each.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -53,7 +53,7 @@
         detail::for_each_linear<BOOST_FUSION_R_ELSE_LREF(Seq)>(
                 fusion::begin(seq)
               , f
- , result_of::empty<Seq>::type());
+ , typename result_of::empty<Seq>::type());
     }
 
     template<int N>

Modified: sandbox/SOC/2009/fusion/boost/fusion/algorithm/query/detail/any.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/algorithm/query/detail/any.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/query/detail/any.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -6,8 +6,8 @@
     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 ==============================================================================*/
 
-#ifndef BOOST_FUSION_ALGORITHM_QUERY_DETAIL_ALL_HPP
-#define BOOST_FUSION_ALGORITHM_QUERY_DETAIL_ALL_HPP
+#ifndef BOOST_FUSION_ALGORITHM_QUERY_DETAIL_ANY_HPP
+#define BOOST_FUSION_ALGORITHM_QUERY_DETAIL_ANY_HPP
 
 #include <boost/fusion/sequence/intrinsic/empty.hpp>
 #include <boost/fusion/sequence/intrinsic/size.hpp>

Added: sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/detail/pp/zip.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/detail/pp/zip.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -0,0 +1,81 @@
+/*=============================================================================
+ Copyright (c) 2001-2006 Joel de Guzman
+ Copyright (c) 2006 Dan Marsden
+
+ 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)
+==============================================================================*/
+
+#ifndef BOOST_FUSION_ALGORITHM_TRANSFORMATION_DETAIL_PP_ZIP_HPP
+#define BOOST_FUSION_ALGORITHM_TRANSFORMATION_DETAIL_PP_ZIP_HPP
+
+#include <boost/fusion/view/zip_view.hpp>
+#include <boost/fusion/adapted/mpl.hpp>
+#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/container/vector/convert.hpp>
+#include <boost/preprocessor/repetition/enum.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/iteration/iterate.hpp>
+#include <boost/mpl/vector.hpp>
+#include <boost/mpl/transform.hpp>
+#include <boost/mpl/placeholders.hpp>
+
+namespace boost { namespace fusion {
+
+ struct void_;
+
+ namespace result_of
+ {
+ template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PP_INC(FUSION_MAX_ZIP_SEQUENCES), typename T, fusion::void_)>
+ struct zip;
+ }
+
+#define BOOST_PP_FILENAME_1 \
+ <boost/fusion/algorithm/transformation/detail/pp/zip.hpp>
+#define BOOST_PP_ITERATION_LIMITS (2, FUSION_MAX_ZIP_SEQUENCES)
+#include BOOST_PP_ITERATE()
+
+}}
+
+#endif
+
+#else
+
+#define ZIP_ITERATION BOOST_PP_ITERATION()
+
+ namespace result_of
+ {
+ template< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, typename T) >
+#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
+ #define TEXT(z, n, text) , text
+ struct zip< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) BOOST_PP_REPEAT_FROM_TO(BOOST_PP_DEC(ZIP_ITERATION), FUSION_MAX_ZIP_SEQUENCES, TEXT, void_) >
+ #undef TEXT
+#else
+ struct zip< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) >
+#endif
+ {
+ typedef mpl::vector< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) > sequences;
+ typedef typename mpl::transform<sequences, detail::add_lref<mpl::_> >::type ref_params;
+ typedef zip_view<typename result_of::as_vector<ref_params>::type> type;
+ };
+ }
+
+#define FUSION_REF_PARAM(z, n, data) const T ## n&
+
+ template<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, typename T)>
+ inline typename result_of::zip<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, const T)>::type
+ zip(BOOST_PP_ENUM_BINARY_PARAMS(ZIP_ITERATION, T, const& t))
+ {
+ fusion::vector<BOOST_PP_ENUM(ZIP_ITERATION, FUSION_REF_PARAM, _)> seqs(
+ BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, t));
+ return typename result_of::zip<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, const T)>::type(
+ seqs);
+ }
+
+#undef FUSION_REF_PARAM
+#undef ZIP_ITERATION
+
+#endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/detail/replace_if.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/detail/replace_if.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/detail/replace_if.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -8,6 +8,8 @@
 #ifndef BOOST_FUSION_ALGORITHM_TRANSFORMATION_DETAIL_REPLACE_IF_HPP
 #define BOOST_FUSION_ALGORITHM_TRANSFORMATION_DETAIL_REPLACE_IF_HPP
 
+#include <boost/fusion/support/result_of.hpp>
+
 #include <boost/mpl/if.hpp>
 #include <boost/type_traits/is_convertible.hpp>
 
@@ -43,19 +45,23 @@
         }
     };
 
+ //TODO !!!
     template <typename F, typename NewValue>
     struct replacer_if
     {
- replacer_if(replacer_if&& replacer_if)
- : f(replacer_if.f)
- , new_value(replacer_if.new_value)
+ replacer_if(BOOST_FUSION_R_ELSE_CLREF(replacer_if) replacer)
+ : f(BOOST_FUSION_FORWARD(
+ BOOST_FUSION_R_ELSE_CLREF(replacer_if),replacer).f)
+ , new_value(BOOST_FUSION_FORWARD(
+ BOOST_FUSION_R_ELSE_CLREF(replacer_if),replacer).new_value)
         {}
 
- template<typename F_, typename NewValue_>
- replacer_if(BOOST_FUSION_R_ELSE_LREF(F_) f,
- BOOST_FUSION_R_ELSE_LREF(NewValue_) new_value)
- : f(f)
- , new_value(new_value)
+ template<typename OtherF, typename OtherNewValue>
+ replacer_if(
+ BOOST_FUSION_R_ELSE_LREF(OtherF) other_f,
+ BOOST_FUSION_R_ELSE_LREF(OtherNewValue) other_new_value)
+ : f(BOOST_FUSION_FORWARD(OtherF,other_f))
+ , new_value(BOOST_FUSION_FORWARD(OtherNewValue,other_new_value))
         {}
 
         template<typename Params>
@@ -76,7 +82,6 @@
             type;
         };
 
- //TODO cschmidt: template result in f?
         template <typename U>
         typename result<replacer_if(U)>::type
         operator()(BOOST_FUSION_R_ELSE_LREF(U) x) const

Added: sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/detail/variadic_templates/zip.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/detail/variadic_templates/zip.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -0,0 +1,40 @@
+// Copyright Christopher Schmidt 2009.
+// 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)
+
+#ifndef BOOST_FUSION_ALGORITHM_TRANSFORMATION_DETAIL_VARIADIC_TEMPLATES_ZIP_HPP
+#define BOOST_FUSION_ALGORITHM_TRANSFORMATION_DETAIL_VARIADIC_TEMPLATES_ZIP_HPP
+
+#include <boost/fusion/container/vector.hpp>
+#include <boost/fusion/container/generation/vector_tie.hpp>
+#include <boost/fusion/view/zip_view.hpp>
+#include <boost/fusion/support/ref.hpp>
+
+namespace boost { namespace fusion {
+
+ namespace result_of
+ {
+ template<typename... Seqs>
+ struct zip
+ {
+ typedef
+ zip_view<
+ vector<typename detail::add_lref<Seqs>::type...>
+ >
+ type;
+ };
+ }
+
+ template<typename... Seqs>
+ inline typename result_of::zip<BOOST_FUSION_R_ELSE_LREF(Seqs)...>::type
+ zip(BOOST_FUSION_R_ELSE_LREF(Seqs)... seqs)
+ {
+ return typename
+ result_of::zip<BOOST_FUSION_R_ELSE_LREF(Seqs)...>::type(
+ vector_tie(seqs...));
+ }
+
+}}
+
+#endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/replace_if.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/replace_if.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/replace_if.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -24,6 +24,13 @@
         struct replace_if
         {
             typedef
+ detail::replacer_if<
+ typename detail::as_fusion_element<F>::type
+ , typename detail::as_fusion_element<T>::type
+ >
+ replacer;
+
+ typedef
                 transform_view<
                 //TODO ?!
                     typename detail::result_of_forward_as<
@@ -32,10 +39,7 @@
                             typename detail::remove_reference<Seq>::type
>::type
>::type
- , detail::replacer_if<
- typename detail::as_fusion_element<F>::type
- , typename detail::as_fusion_element<T>::type
- >
+ , replacer
>
             type;
         };
@@ -56,22 +60,11 @@
                 BOOST_FUSION_R_ELSE_LREF(Seq)
               , BOOST_FUSION_R_ELSE_LREF(F)
               , BOOST_FUSION_R_ELSE_LREF(NewValue)
- >::type
- type;
-
- typedef
- detail::replacer_if<
- typename detail::as_fusion_element<
- BOOST_FUSION_R_ELSE_LREF(F)
- >::type
- , typename detail::as_fusion_element<
- BOOST_FUSION_R_ELSE_LREF(NewValue)
- >::type
>
- replacer;
+ result;
 
- return type(BOOST_FUSION_FORWARD(Seq,seq),
- replacer(BOOST_FUSION_FORWARD(F,pred),
+ return typename result::type(BOOST_FUSION_FORWARD(Seq,seq),
+ typename result::replacer(BOOST_FUSION_FORWARD(F,pred),
                         BOOST_FUSION_FORWARD(NewValue,new_value)));
     }
 

Modified: sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/zip.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/zip.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/algorithm/transformation/zip.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -9,77 +9,16 @@
 #ifndef BOOST_FUSION_ALGORITHM_TRANSFORMATION_ZIP_HPP
 #define BOOST_FUSION_ALGORITHM_TRANSFORMATION_ZIP_HPP
 
-#include <boost/fusion/view/zip_view.hpp>
-#include <boost/fusion/adapted/mpl.hpp>
-#include <boost/fusion/container/vector.hpp>
-#include <boost/fusion/container/vector/convert.hpp>
-#include <boost/preprocessor/repetition/enum.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#include <boost/preprocessor/repetition/repeat_from_to.hpp>
-#include <boost/preprocessor/arithmetic/inc.hpp>
-#include <boost/preprocessor/iteration/iterate.hpp>
-#include <boost/mpl/vector.hpp>
-#include <boost/mpl/transform.hpp>
-#include <boost/mpl/placeholders.hpp>
-
-#if !defined(FUSION_MAX_ZIP_SEQUENCES)
-#define FUSION_MAX_ZIP_SEQUENCES 10
-#endif
-
-namespace boost { namespace fusion {
-
- struct void_;
-
- namespace result_of
- {
- template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PP_INC(FUSION_MAX_ZIP_SEQUENCES), typename T, fusion::void_)>
- struct zip;
- }
-
-#define BOOST_PP_FILENAME_1 \
- <boost/fusion/algorithm/transformation/zip.hpp>
-#define BOOST_PP_ITERATION_LIMITS (2, FUSION_MAX_ZIP_SEQUENCES)
-#include BOOST_PP_ITERATE()
-
-}}
-
+#if defined(BOOST_NO_VARIADIC_TEMPLATES) || !defined(BOOST_FUSION_CPP0X_NO_DEPRECEATED)
+# ifndef FUSION_MAX_ZIP_SEQUENCES
+# define FUSION_MAX_ZIP_SEQUENCES 10
+# endif
 #endif
 
+#ifdef BOOST_NO_VARIADIC_TEMPLATES
+# include <boost/fusion/algorithm/transformation/detail/pp/zip.hpp>
 #else
-
-#define ZIP_ITERATION BOOST_PP_ITERATION()
-
- namespace result_of
- {
- template< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, typename T) >
-#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS)
- #define TEXT(z, n, text) , text
- struct zip< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) BOOST_PP_REPEAT_FROM_TO(BOOST_PP_DEC(ZIP_ITERATION), FUSION_MAX_ZIP_SEQUENCES, TEXT, void_) >
- #undef TEXT
-#else
- struct zip< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) >
+# include <boost/fusion/algorithm/transformation/detail/variadic_templates/zip.hpp>
 #endif
- {
- typedef mpl::vector< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) > sequences;
- typedef typename mpl::transform<sequences, detail::add_lref<mpl::_> >::type ref_params;
- typedef zip_view<typename result_of::as_vector<ref_params>::type> type;
- };
- }
-
-#define FUSION_REF_PARAM(z, n, data) const T ## n&
-
- template<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, typename T)>
- inline typename result_of::zip<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, const T)>::type
- zip(BOOST_PP_ENUM_BINARY_PARAMS(ZIP_ITERATION, T, const& t))
- {
- fusion::vector<BOOST_PP_ENUM(ZIP_ITERATION, FUSION_REF_PARAM, _)> seqs(
- BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, t));
- return typename result_of::zip<BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, const T)>::type(
- seqs);
- }
-
-#undef FUSION_REF_PARAM
-#undef ZIP_ITERATION
 
 #endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector_impl.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector_impl.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector_impl.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -149,8 +149,7 @@
         typedef mpl::int_<sizeof...(Elements)> size;
 
         vector()
- {
- }
+ {}
 
 #define VECTOR_CTOR(COMBINATION)\
         vector(vector COMBINATION vec)\
@@ -168,8 +167,7 @@
                typename enable_if<
                    is_sequence_assign<SeqAssign> >::type* =NULL)
           : base(detail::assign_by_deref(),fusion::begin(seq.get()))
- {
- }
+ {}
 
         /*
         template<typename Seq>
@@ -177,8 +175,7 @@
                                 BOOST_FUSION_R_ELSE_CLREF(Seq)>::type seq)
           : base(detail::assign_by_deref(),
                  fusion::begin(BOOST_FUSION_FORWARD(Seq,seq.seq)))
- {
- }
+ {}
         */
 
 #ifdef BOOST_NO_RVALUE_REFERENCES
@@ -186,15 +183,13 @@
                typename detail::call_param<OtherElements>::type... others)
           : base(assign_directly(),others...)
           , _element(head)
- {
- }
+ {}
 #else
         template<typename... OtherElements>
         vector(OtherElements&&... other_elements)
           : base(detail::assign_directly(),
                  std::forward<OtherElements>(other_elements)...)
- {
- }
+ {}
 #endif
 
         template<typename Seq>

Modified: sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector_n.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector_n.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/container/vector/detail/variadic_templates/vector_n.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -11,38 +11,43 @@
 template <BOOST_PP_ENUM_PARAMS(N, typename T)>
 #endif
 struct BOOST_PP_CAT(vector, N)
- : vector<BOOST_PP_ENUM_PARAMS(N, T)>
+ : vector<BOOST_PP_ENUM_PARAMS(N, T)>
 {
 private:
     typedef vector<BOOST_PP_ENUM_PARAMS(N, T)> base;
 
 public:
     BOOST_PP_CAT(vector, N)()
- {
- }
+ {}
+
+#define VECTOR_CTOR(COMBINATION)\
+ BOOST_PP_CAT(vector, N)(BOOST_PP_CAT(vector, N) COMBINATION vec)\
+ : base(sequence_assign(\
+ BOOST_FUSION_FORWARD(BOOST_PP_CAT(vector, N) COMBINATION,vec)))\
+ {}
+
+ BOOST_FUSION_ALL_CV_REF_COMBINATIONS(VECTOR_CTOR)
+
+#undef VECTOR_CTOR
 
     template<typename Arg>
     BOOST_PP_CAT(vector, N)(BOOST_FUSION_R_ELSE_CLREF(Arg) arg)
- : base(BOOST_FUSION_FORWARD(Arg,arg))
- {
- }
+ : base(BOOST_FUSION_FORWARD(Arg,arg))
+ {}
 
 #if N > 1
 # ifdef BOOST_NO_RVALUE_REFERENCES
- BOOST_PP_CAT(vector, N)(BOOST_PP_ENUM_BINARY_PARAMS(
- N, typename detail::call_param<T, >::type _))
- : base(BOOST_PP_ENUM_PARAMS(N, _))
- {
- }
+ BOOST_PP_CAT(vector, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, const T, & a))
+ : base(BOOST_PP_ENUM_PARAMS(N, a))
+ {}
 # else
 # define FORWARD_ARGUMENT(Z, INDEX, _) std::forward<\
             BOOST_PP_CAT(OtherT,INDEX)>(BOOST_PP_CAT(other,INDEX))
 
     template <BOOST_PP_ENUM_PARAMS(N, typename OtherT)>
     BOOST_PP_CAT(vector, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, OtherT,&& other))
- : base(BOOST_PP_ENUM(N, FORWARD_ARGUMENT, _))
- {
- }
+ : base(BOOST_PP_ENUM(N, FORWARD_ARGUMENT, _))
+ {}
 
 # undef FORWARD_ARGUMENT
 # endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/swap.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/swap.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/sequence/intrinsic/swap.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -25,11 +25,7 @@
     {
         struct swap
         {
- template<typename Elem>
- struct result
- {
- typedef void type;
- };
+ typedef void result_type;
 
             template<typename Elem>
             void operator()(Elem const& e) const

Added: sandbox/SOC/2009/fusion/boost/fusion/support/result_of.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/result_of.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -0,0 +1,85 @@
+// Copyright Christopher Schmidt 2009.
+// 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)
+
+#ifndef BOOST_FUSION_SUPPORT_RESULT_OF_HPP
+#define BOOST_FUSION_SUPPORT_RESULT_OF_HPP
+
+#include <boost/utility/result_of.hpp>
+
+//cschmidt: fusion might call result_of on class types without an operator().
+//Therefore we emulate the old behavior if (and only if) the boost
+//implementation falls back to decltype by default.
+
+#ifndef BOOST_NO_DECLTYPE
+# include <boost/fusion/support/ref.hpp>
+
+# include <boost/mpl/has_xxx.hpp>
+# include <boost/mpl/eval_if.hpp>
+
+# include <boost/type_traits/is_function.hpp>
+#endif
+
+namespace boost { namespace fusion { namespace support
+{
+#ifdef BOOST_NO_DECLTYPE
+ using boost::result_of;
+#else
+ namespace detail
+ {
+ BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
+
+ template<typename F>
+ struct get_result_type
+ {
+ typedef typename F::result_type type;
+ };
+
+ template<typename F, typename Sig>
+ struct get_result
+ : F::template result<Sig>
+ {};
+
+ //TODO cschmidt: non-native variadic templates version
+ template<typename IdentityF, typename... Args>
+ struct result_of_class_type
+ {
+ typedef typename
+ mpl::eval_if<
+ detail::has_result_type<IdentityF>
+ , detail::get_result_type<IdentityF>
+ //TODO cschmidt: fallback to boost::result_of (decltype) if
+ //'F::template result' does not exist.
+ //Is this even possible?
+ , detail::get_result<IdentityF,IdentityF(Args...)>
+ >::type
+ type;
+ };
+ }
+
+ template<typename Sig>
+ struct result_of
+ : boost::result_of<Sig>
+ {
+ };
+
+ template<typename F, typename... Args>
+ struct result_of<F(Args...)>
+ {
+ //TODO cschmidt: workaround until is_function supports rvalues
+ typedef typename fusion::detail::identity<F>::type f;
+
+ typedef typename
+ mpl::eval_if<
+ is_function<f>
+ , boost::result_of<F(Args...)>
+ , detail::result_of_class_type<f,Args...>
+ >::type
+ type;
+ };
+#endif
+
+}}}
+
+#endif

Modified: sandbox/SOC/2009/fusion/boost/fusion/support/tag_of.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/support/tag_of.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/support/tag_of.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -14,6 +14,7 @@
 
 #include <boost/mpl/eval_if.hpp>
 #include <boost/mpl/if.hpp>
+#include <boost/mpl/has_xxx.hpp>
 
 namespace boost { namespace fusion
 {

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/transform_view/detail/apply_transform_result.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/transform_view/detail/apply_transform_result.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/transform_view/detail/apply_transform_result.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -9,7 +9,7 @@
 #ifndef BOOST_FUSION_VIEW_TRANSFORM_VIEW_DETAIL_APPLY_TRANSFORM_RESULT_HPP
 #define BOOST_FUSION_VIEW_TRANSFORM_VIEW_DETAIL_APPLY_TRANSFORM_RESULT_HPP
 
-#include <boost/utility/result_of.hpp>
+#include <boost/fusion/support/result_of.hpp>
 
 namespace boost { namespace fusion
 {
@@ -20,19 +20,14 @@
         template <typename F>
         struct apply_transform_result
         {
- //TODO cschmidt: !!!
             template <typename T0, typename T1 = void_>
             struct apply
- : //boost::result_of<F(T0, T1)>
- detail::remove_reference<F>::type::template result<
- typename detail::identity<F>::type(T0, T1)>
+ : support::result_of<F(T0, T1)>
             {};
 
             template <typename T0>
             struct apply<T0, void_>
- : //boost::result_of<F(T0)>
- detail::remove_reference<F>::type::template result<
- typename detail::identity<F>::type(T0)>
+ : support::result_of<F(T0)>
             {};
         };
     }

Modified: sandbox/SOC/2009/fusion/boost/fusion/view/zip_view/zip_view.hpp
==============================================================================
--- sandbox/SOC/2009/fusion/boost/fusion/view/zip_view/zip_view.hpp (original)
+++ sandbox/SOC/2009/fusion/boost/fusion/view/zip_view/zip_view.hpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -136,7 +136,7 @@
         template<typename OtherSeqs>\
         zip_view(zip_view<OtherSeqs> COMBINATION other_view)\
           : seqs(sequence_assign(BOOST_FUSION_FORWARD(\
- zip_view<OtherSeqs> COMBINATION,other_view).seq))\
+ zip_view<OtherSeqs> COMBINATION,other_view).seqs))\
         {}
 
         BOOST_FUSION_ALL_CV_REF_COMBINATIONS(ZIP_VIEW_CTOR)

Modified: sandbox/SOC/2009/fusion/libs/fusion/example/test/main.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/example/test/main.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/example/test/main.cpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -9,7 +9,7 @@
 
 #include <boost/fusion/sequence.hpp>
 #include <boost/fusion/iterator.hpp>
-//#include <boost/fusion/algorithm.hpp>
+#include <boost/fusion/algorithm.hpp>
 #include <boost/fusion/container.hpp>
 #include <boost/fusion/view.hpp>
 

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-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -26,7 +26,7 @@
     [ run algorithm/for_each.cpp : : : : ]
     [ run algorithm/insert_range.cpp : : : : ]
     [ run algorithm/insert.cpp : : : : ]
-# [ run algorithm/join.cpp : : : : ]
+ [ run algorithm/join.cpp : : : : ]
     [ run algorithm/none.cpp : : : : ]
     [ run algorithm/pop_back.cpp : : : : ]
     [ run algorithm/pop_front.cpp : : : : ]
@@ -38,9 +38,9 @@
     [ run algorithm/replace.cpp : : : : ]
     [ run algorithm/reverse.cpp : : : : ]
     [ run algorithm/transform.cpp : : : : ]
-# [ run algorithm/zip_ignore.cpp : : : : ]
-# [ run algorithm/zip.cpp : : : : ]
-# [ run algorithm/zip2.cpp : : : : ]
+ [ run algorithm/zip_ignore.cpp : : : : ]
+ [ run algorithm/zip.cpp : : : : ]
+ [ run algorithm/zip2.cpp : : : : ]
 
 # [ run sequence/adapt_struct.cpp : : : : ]
 # [ run sequence/adapt_assoc_struct.cpp : : : : ]

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/algorithm/fold.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/algorithm/fold.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/algorithm/fold.cpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -37,8 +37,9 @@
     template <typename T, typename State>
     struct result<add_ints_only(T,State)>
     {
- //TODO !!!
         typedef typename boost::fusion::detail::identity<State>::type type;
+ //TODO cschmidt: remove_reference does not support rvalue refs yet,
+ //therefore we use the internal function of fusion!
         //typedef typename boost::remove_const<
         // typename boost::remove_reference<State>::type>::type type;
     };
@@ -93,14 +94,7 @@
 
 struct appender
 {
- //TODO
- //typedef std::string result_type;
-
- template<typename>
- struct result
- {
- typedef std::string type;
- };
+ typedef std::string result_type;
 
     std::string operator()(char c, std::string const& str) const
     {
@@ -183,8 +177,7 @@
 
     {
         vector<int, int> vec(1,2);
- //TODO!!!
- //BOOST_TEST(fusion::fold(vec, 0, add) == 3);
+ BOOST_TEST(fusion::fold(vec, 0, add) == 3);
     }
 
     {
@@ -227,8 +220,7 @@
 
     {
         vector<int, int> vec(1,2);
- //TODO!!!
- //BOOST_TEST(fusion::accumulate(vec, 0, add) == 3);
+ BOOST_TEST(fusion::accumulate(vec, 0, add) == 3);
     }
 
     return boost::report_errors();

Modified: sandbox/SOC/2009/fusion/libs/fusion/test/sequence/cons.cpp
==============================================================================
--- sandbox/SOC/2009/fusion/libs/fusion/test/sequence/cons.cpp (original)
+++ sandbox/SOC/2009/fusion/libs/fusion/test/sequence/cons.cpp 2009-07-05 17:22:39 EDT (Sun, 05 Jul 2009)
@@ -14,9 +14,8 @@
 #include <boost/fusion/container/generation/make_vector.hpp>
 #include <boost/fusion/sequence/comparison/equal_to.hpp>
 #include <boost/lambda/lambda.hpp>
-//TODO cschmidt: !!!!
-//#include <boost/fusion/algorithm/iteration/for_each.hpp>
-//#include <boost/fusion/algorithm/transformation/filter_if.hpp>
+#include <boost/fusion/algorithm/iteration/for_each.hpp>
+#include <boost/fusion/algorithm/transformation/filter_if.hpp>
 #include <boost/fusion/sequence/io/out.hpp>
 
 #include <boost/type_traits/is_same.hpp>
@@ -39,9 +38,6 @@
         cons<int, cons<std::string> > ns =
             make_cons(1, make_cons(hello));
 
- //cschmidt: boost::fusion::next collides with std::next on
- //gcc <= 4.4 due to broken SFINAE support!
-
         BOOST_TEST((*begin(ns) == 1));
         BOOST_TEST((*boost::fusion::next(begin(ns)) == hello));
 
@@ -51,10 +47,10 @@
         BOOST_TEST((*begin(ns) == 2));
         BOOST_TEST((*boost::fusion::next(begin(ns)) == hello + ' '));
 
- //for_each(ns, boost::lambda::_1 += ' ');
+ for_each(ns, boost::lambda::_1 += ' ');
 
- //BOOST_TEST((*begin(ns) == 2 + ' '));
- //BOOST_TEST((*boost::fusion::next(begin(ns)) == hello + ' ' + ' '));
+ BOOST_TEST((*begin(ns) == 2 + ' '));
+ BOOST_TEST((*boost::fusion::next(begin(ns)) == hello + ' ' + ' '));
     }
 
     {
@@ -74,10 +70,10 @@
             make_cons(1, make_cons(1.1f));
 
         BOOST_TEST((t == nf));
- //BOOST_TEST((vector<int>(1) == filter_if<is_same<boost::mpl::_, int> >(nf)));
+ BOOST_TEST((vector<int>(1) == filter_if<is_same<boost::mpl::_, int> >(nf)));
 
         std::cout << nf << std::endl;
- //std::cout << filter_if<is_same<boost::mpl::_, int> >(nf) << std::endl;
+ std::cout << filter_if<is_same<boost::mpl::_, int> >(nf) << std::endl;
     }
 
     {


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