|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r66638 - in sandbox/statistics/support/boost/assign/v2: anon detail/config detail/functor put/compose/functor put/generic put/modifier put/sub ref/anon/csv ref/fusion_matrix ref/wrapper
From: erwann.rogard_at_[hidden]
Date: 2010-11-18 12:16:12
Author: e_r
Date: 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
New Revision: 66638
URL: http://svn.boost.org/trac/boost/changeset/66638
Log:
1- Adding support for C++0x (not done) 2- Cleaner macros under C++03 for ref/anon/csv. 3- ref/fusion_matrix now internally uses boost::tuple<>
Text files modified:
sandbox/statistics/support/boost/assign/v2/anon/csv.hpp | 46 +++++
sandbox/statistics/support/boost/assign/v2/detail/config/enable_cpp0x.hpp | 47 +++---
sandbox/statistics/support/boost/assign/v2/detail/functor/constructor.hpp | 34 +++
sandbox/statistics/support/boost/assign/v2/detail/functor/crtp_unary_and_up.hpp | 117 ++++++++++++----
sandbox/statistics/support/boost/assign/v2/detail/functor/identity.hpp | 27 +++
sandbox/statistics/support/boost/assign/v2/detail/functor/new.hpp | 57 +++++--
sandbox/statistics/support/boost/assign/v2/put/compose/functor/composer.hpp | 118 ++++++++++-----
sandbox/statistics/support/boost/assign/v2/put/generic/crtp.hpp | 106 +++++++++-----
sandbox/statistics/support/boost/assign/v2/put/modifier/at_next.hpp | 15 +
sandbox/statistics/support/boost/assign/v2/put/modifier/incr_lookup.hpp | 19 +-
sandbox/statistics/support/boost/assign/v2/put/modifier/repeat.hpp | 42 +++--
sandbox/statistics/support/boost/assign/v2/put/modifier/xxx.hpp | 16 +
sandbox/statistics/support/boost/assign/v2/put/sub/csv.hpp | 59 ++++++-
sandbox/statistics/support/boost/assign/v2/ref/anon/csv/assign_copy.hpp | 5
sandbox/statistics/support/boost/assign/v2/ref/anon/csv/assign_rebind.hpp | 15 +
sandbox/statistics/support/boost/assign/v2/ref/anon/csv/assign_xxx.hpp | 121 +++++++++++++---
sandbox/statistics/support/boost/assign/v2/ref/anon/csv/make.hpp | 117 ++++++++++++++--
sandbox/statistics/support/boost/assign/v2/ref/anon/csv/pp.hpp | 63 --------
sandbox/statistics/support/boost/assign/v2/ref/fusion_matrix/container.hpp | 283 +++++++++++++++++++++++++++++++--------
sandbox/statistics/support/boost/assign/v2/ref/fusion_matrix/fwd.hpp | 20 ++
sandbox/statistics/support/boost/assign/v2/ref/wrapper/base.hpp | 3
sandbox/statistics/support/boost/assign/v2/ref/wrapper/framework.hpp | 2
sandbox/statistics/support/boost/assign/v2/ref/wrapper/wrapper.hpp | 1
23 files changed, 943 insertions(+), 390 deletions(-)
Modified: sandbox/statistics/support/boost/assign/v2/anon/csv.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/anon/csv.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/anon/csv.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -9,21 +9,54 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_ANON_CSV_ER_2010_HPP
#define BOOST_ASSIGN_V2_ANON_CSV_ER_2010_HPP
+#include <boost/assign/v2/detail/keyword/nil.hpp>
+#include <boost/assign/v2/anon/make.hpp>
+#include <boost/assign/v2/anon/cont.hpp>
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#else
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/arithmetic/inc.hpp>
-
-#include <boost/assign/v2/detail/keyword/nil.hpp>
#include <boost/assign/v2/detail/config/limit_csv_arity.hpp>
-
-#include <boost/assign/v2/anon/make.hpp>
-#include <boost/assign/v2/anon/cont.hpp>
+#endif
namespace boost{
namespace assign{
namespace v2{
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+namespace csv_anon_aux{
+ template<typename T,typename R>
+ void impl(R& r){}
+
+ template<typename T, typename R,typename...Args>
+ void impl(
+ R& r,
+ T const& t,
+ Args&&...args
+ )
+ {
+ r( t );
+ csv_anon_aux::impl<T>(r, std::forward<Args>( args )... );
+ }
+
+}//csv_anon_aux
+
+ template<typename T,typename...Args>
+ typename result_of::anon<T>::type
+ // implicit conversion to T desired
+ csv_anon(T const& t, Args&&...args)
+ {
+ typedef typename result_of::anon<T>::type result_;
+ result_ result = anon<T>( v2::_nil );
+ csv_anon_aux::impl<T>(result, std::forward<Args>(args)...);
+ return result;
+ }
+
+#else
#define MACRO1(z, i, data) ( BOOST_PP_CAT(_, i) )
#define MACRO2(z, N, data)\
template<typename T>\
@@ -34,13 +67,14 @@
}\
/**/
BOOST_PP_REPEAT_FROM_TO(
- 1,
+ 1,
BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_CSV_ARITY),
MACRO2,
~
)
#undef MACRO1
#undef MACRO2
+#endif
}// v2
}// assign
Modified: sandbox/statistics/support/boost/assign/v2/detail/config/enable_cpp0x.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/config/enable_cpp0x.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/config/enable_cpp0x.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -1,12 +1,12 @@
-////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to 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) //
-////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2010 Erwann Rogard //
+// Use, modification and distribution are subject to 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/preprocessor/logical/and.hpp>
#ifndef BOOST_ASSIGN_V2_ENABLE_CPP0X
#if __GNUC__ && __GXX_EXPERIMENTAL_CXX0X__
@@ -16,17 +16,18 @@
#endif
#endif
-// -- TODO add check for MSVC when support for variadic template becomes
-// available
-//
-// -- In principle this is more portable,
-// #include <boost/preprocessor/logical/bool.hpp>
-// #define BOOST_ASSIGN_V2_ENABLE_CPP0X \
-// BOOST_PP_BOOL(__cplusplus > 199711L) \
-// /**/
-// but GCC is non-conformant.
-//
-// -- Sources:
-// http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html#Common-Predefined-Macros
-// http://www2.research.att.com/~bs/C++0xFAQ.html
-// http://msdn.microsoft.com/en-us/library/dd465215.aspx
+/*
+ -- TODO add check for MSVC when support for variadic template becomes
+ available
+
+ -- In principle this is more portable,
+ #include <boost/preprocessor/logical/bool.hpp>
+ #define BOOST_ASSIGN_V2_ENABLE_CPP0X BOOST_PP_BOOL(__cplusplus > 199711L)
+
+ but GCC is non-conformant.
+
+ -- Sources:
+ http:gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html#Common-Predefined-Macros
+ http:www2.research.att.com/~bs/C++0xFAQ.html
+ http:msdn.microsoft.com/en-us/library/dd465215.aspx
+*/
Modified: sandbox/statistics/support/boost/assign/v2/detail/functor/constructor.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/functor/constructor.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/functor/constructor.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -9,15 +9,20 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_DETAIL_FUNCTOR_CONSTRUCTOR_ER_2010_HPP
#define BOOST_ASSIGN_V2_DETAIL_FUNCTOR_CONSTRUCTOR_ER_2010_HPP
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#include <boost/assign/v2/detail/type_traits/container/value.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#else
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/range/reference.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/mpl/always.hpp>
-#include <boost/assign/v2/detail/type_traits/container/value.hpp>
#include <boost/assign/v2/detail/config/limit_arity.hpp>
#include <boost/assign/v2/detail/functor/crtp_unary_and_up.hpp>
+#endif
namespace boost{
namespace assign{
@@ -25,14 +30,17 @@
namespace functor_aux{
template<typename T>
- class constructor : public functor_aux::crtp_unary_and_up<
+ class constructor
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+// do nothing
+#else
+ : public functor_aux::crtp_unary_and_up<
functor_aux::constructor<T>,
boost::mpl::always<T>
>
+#endif
{
typedef functor_aux::constructor<T> this_;
- typedef boost::mpl::always<T> meta_result_;
- typedef functor_aux::crtp_unary_and_up<this_, meta_result_> super_;
public:
@@ -40,12 +48,25 @@
T operator()()const{ return T(); }
- using super_::operator();
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+ template<typename... Args>
+ T operator()(Args&&...args)const
+ {
+ return T( std::forward<Args>(args)... );
+ }
+#else
+ protected:
+ typedef boost::mpl::always<T> meta_result_;
+ typedef functor_aux::crtp_unary_and_up<this_, meta_result_> super_;
+
+ public:
+
+ using super_::operator();
#define MACRO(z,N,data) \
template<BOOST_PP_ENUM_PARAMS(N,typename T)> \
T impl( BOOST_PP_ENUM_BINARY_PARAMS(N, T, &_) )const{ \
- return T( BOOST_PP_ENUM_PARAMS(N,_) ); \
+ return T( BOOST_PP_ENUM_PARAMS(N, _) ); \
} \
/**/
BOOST_PP_REPEAT_FROM_TO(
@@ -56,6 +77,7 @@
)
#undef MACRO
+#endif
};
template<typename V>
Modified: sandbox/statistics/support/boost/assign/v2/detail/functor/crtp_unary_and_up.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/functor/crtp_unary_and_up.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/functor/crtp_unary_and_up.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -9,6 +9,36 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_DETAIL_FUNCTOR_CRTP_UNARY_AND_UP_ER_2010_HPP
#define BOOST_ASSIGN_V2_DETAIL_FUNCTOR_CRTP_UNARY_AND_UP_ER_2010_HPP
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+
+#include <iostream> // TODO remove
+
+#ifndef BOOST_ASSIGN_V2_ENABLE_CPP0X
+#error
+#endif
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+// There should be no use for this file under CPP0x
+
+#else
+
+// The crtp defined below makes it easy to overload on the number of
+// arguments, while allowing within a certain limit, any mixture of
+// lvalue and rvalues. Specifically,
+// let
+// m = BOOST_ASSIGN_V2_LIMIT_LVALUE_CONST_ARITY
+// n = BOOST_ASSIGN_V2_LIMIT_ARITY
+//
+// Given a metafunction class, F, and a derived class, D, that defines
+// template<typename T0, ..., typename Tk>
+// typename apply1<F, mpl::vector<T0,...,Tk> >::type
+// impl(T0& , ..., Tk&)const;
+// for k = 0, ..., n-1, crtp<F,D> defines, under C++03, a set of overloaded
+// operator()'s, each forwarding to impl(), for each combination of lvalues and
+// const arguments for k = 0, ..., m-1, and either only lvalues or only const
+// for k = m, ..., n-1.
+
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
@@ -18,38 +48,24 @@
#include <boost/preprocessor/seq/first_n.hpp>
#include <boost/mpl/apply.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/vector.hpp>
+#include <boost/mpl/transform.hpp>
+
+#include <boost/type_traits/remove_reference.hpp>
+#include <boost/type_traits/is_reference.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/is_const.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/assign/v2/detail/config/limit_arity.hpp>
#include <boost/assign/v2/detail/config/limit_lvalue_const_arity.hpp>
-#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
#include <boost/assign/v2/detail/pp/args.hpp>
#include <boost/assign/v2/detail/pp/params.hpp>
#include <boost/assign/v2/detail/pp/seq.hpp>
-#ifndef BOOST_ASSIGN_V2_ENABLE_CPP0X
-#error
-#endif
-
-#if BOOST_ASSIGN_V2_ENABLE_CPP0X
-#include <boost/mpl/detail/variadic_vector.hpp>
-#endif
-
-// Notation:
-// m = BOOST_ASSIGN_V2_LIMIT_LVALUE_CONST_ARITY
-// n = BOOST_ASSIGN_V2_LIMIT_ARITY
-//
-// Given a metafunction class, F, and a derived class, D, that defines
-// template<typename T0, ..., typename Tk>
-// typename apply1<F, mpl::vector<T0,...,Tk> >::type
-// impl(T0& , ..., Tk&)const;
-// for k = 0, ..., n-1, crtp<F,D> defines, under C++03, a set of overloaded
-// operator()'s, each forwarding to impl(), for each combination of lvalues and
-// const arguments for k = 0, ..., m-1, and either only lvalues or only const
-// for k = m, ..., n-1. Under C++0x, operator() forwards to impl() for any
-// combination of lvalues and const and k = 0,...,n-1.
-
namespace boost{
namespace assign{
namespace v2{
@@ -66,14 +82,52 @@
public:
#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+/*
+ template<typename Vec>
+ struct apply_f
+ {
+ template<typename T>
+ struct op : boost::mpl::eval_if<
+ boost::is_reference<T>,
+ boost::remove_reference<T>,
+ boost::add_const<T>
+ >
+ {
+ };
+
+ typedef typename boost::mpl::transform<
+ Vec,
+ op<boost::mpl::_>
+ >::type unrefs_;
+ typedef typename boost::mpl::apply1<
+ F,
+ unrefs_
+ >::type type;
+ };
+
template<typename T0,typename...Args>
- typename boost::mpl::apply1<
- F,
- typename boost::mpl::detail::variadic_vector<T0, Args...>::type
+// typename boost::mpl::apply1<
+// F,
+// typename boost::mpl::detail::variadic_vector<T0, Args...>::type
+// >::type
+ typename apply_f<
+ typename boost::mpl::detail::variadic_vector<
+ T0,
+ Args...
+ >::type
>::type
operator()(T0&& t0, Args&&...args)const{
- return this->derived().template impl<T0, Args...>(t0, args...);
+ //return this->derived().template impl<T0, Args...>(t0, args...);
+ return this->derived().template impl(
+ std::forward<T0>( t0 ),
+ std::forward<Args>( args )...
+ //t0,
+ //args...
+ );
}
+*/
+
#else
#define MACRO1(r, SeqU) \
@@ -96,8 +150,8 @@
) \
/**/
BOOST_PP_REPEAT(
- BOOST_ASSIGN_V2_LIMIT_LVALUE_CONST_ARITY,
- MACRO2,
+ BOOST_ASSIGN_V2_LIMIT_LVALUE_CONST_ARITY,
+ MACRO2,
~
)
@@ -145,4 +199,7 @@
}// assign
}// boost
-#endif
+
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+#endif // BOOST_ASSIGN_V2_DETAIL_FUNCTOR_CRTP_UNARY_AND_UP_ER_2010_HPP
Modified: sandbox/statistics/support/boost/assign/v2/detail/functor/identity.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/functor/identity.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/functor/identity.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -9,6 +9,10 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_DETAIL_FUNCTOR_IDENTITY_ER_2010_HPP
#define BOOST_ASSIGN_V2_DETAIL_FUNCTOR_IDENTITY_ER_2010_HPP
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#else
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/int.hpp>
@@ -16,12 +20,16 @@
#include <boost/mpl/eval_if.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/assign/v2/detail/functor/crtp_unary_and_up.hpp>
+#endif
namespace boost{
namespace assign{
namespace v2{
namespace functor_aux{
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+//do nothing
+#else
struct result_of_identity{
template<typename V>
@@ -33,7 +41,7 @@
template<typename V>
struct enable
{
- typedef typename boost::mpl::at_c<V,0>::type t_;
+ typedef typename boost::mpl::at_c<V, 0>::type t_;
typedef typename boost::add_reference<t_>::type type;
};
@@ -49,16 +57,27 @@
};
- struct identity : functor_aux::crtp_unary_and_up<
+#endif
+
+ struct identity
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+// do nothing
+#else
+ : functor_aux::crtp_unary_and_up<
functor_aux::identity,
functor_aux::result_of_identity
>
+#endif
{
identity(){}
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+ template<typename T>
+ T&& operator()(T&& t)const{ return t; }
+#else
template<typename T> T& impl(T& t)const{ return t; }
template<typename T> T const& impl(T const& t)const{ return t; }
-
+#endif
};
}// functor_aux
@@ -66,7 +85,7 @@
functor_aux::identity const _identity = functor_aux::identity();
}
}// v2
-}// assign
+}// assigns
}// boost
#endif
Modified: sandbox/statistics/support/boost/assign/v2/detail/functor/new.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/functor/new.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/functor/new.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -9,40 +9,60 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_DETAIL_FUNCTOR_NEW_ER_2010_HPP
#define BOOST_ASSIGN_V2_DETAIL_FUNCTOR_NEW_ER_2010_HPP
-#include <memory>
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#else
+#include <memory> // TODO what for?!
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/mpl/always.hpp>
#include <boost/range/reference.hpp>
#include <boost/type_traits/remove_cv.hpp>
-#include <boost/mpl/always.hpp>
#include <boost/assign/v2/detail/type_traits/container/value.hpp>
#include <boost/assign/v2/detail/config/limit_arity.hpp>
#include <boost/assign/v2/detail/functor/crtp_unary_and_up.hpp>
+#endif
namespace boost{
-namespace assign{
+namespace assign{
namespace v2{
namespace functor_aux{
template<typename T>
- class new_ : public functor_aux::crtp_unary_and_up<
- functor_aux::new_<T>,
- boost::mpl::always<T*>
+ class new_
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+// do nothing
+#else
+ : public functor_aux::crtp_unary_and_up<
+ functor_aux::new_<T>,
+ boost::mpl::always<T*>
>
+#endif
{
typedef T* ptr_;
typedef functor_aux::new_<T> this_;
- typedef boost::mpl::always< ptr_ > meta_result_;
- typedef functor_aux::crtp_unary_and_up<this_, meta_result_> super_;
-
+
public:
-
+
typedef ptr_ result_type;
-
+
new_(){}
-
- result_type operator()()const{ return new T(); }
+
+ result_type operator()()const{ return new T(); }
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+ template<typename... Args>
+ result_type operator()(Args&&...args)const
+ {
+ return new T(std::forward<Args>(args)...);
+ }
+#else
+ protected:
+ typedef boost::mpl::always< ptr_ > meta_result_;
+ typedef functor_aux::crtp_unary_and_up<this_, meta_result_> super_;
+ public:
using super_::operator();
@@ -59,7 +79,8 @@
~
)
#undef MACRO
-
+#endif
+
};
template<typename V>
@@ -75,7 +96,7 @@
struct foo
{
int i;
-
+
foo() : i(0)
{ }
foo( int i ) : i(i)
@@ -93,7 +114,7 @@
{
foo_bar( int i ) : foo(i)
{ }
-
+
foo_bar( int i, const char* )
{ }
};
@@ -102,7 +123,7 @@
{
return l.i < r.i;
}
-
+
}// functor_aux
namespace result_of{
@@ -121,7 +142,7 @@
typedef typename result_of::new_<T>::type result_;
return result_();
}
-
+
}// v2
}// assign
}// boost
Modified: sandbox/statistics/support/boost/assign/v2/put/compose/functor/composer.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/put/compose/functor/composer.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/put/compose/functor/composer.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -9,15 +9,6 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_PUT_COMPOSE_COMPOSER_ER_2010_HPP
#define BOOST_ASSIGN_V2_PUT_COMPOSE_COMPOSER_ER_2010_HPP
-#include <boost/preprocessor/arithmetic/inc.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#include <boost/preprocessor/repetition/repeat.hpp>
-#include <boost/preprocessor/repetition/repeat_from_to.hpp>
-#include <boost/preprocessor/seq/for_each_product.hpp>
-#include <boost/preprocessor/seq/first_n.hpp>
-
#include <boost/mpl/apply.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/placeholders.hpp>
@@ -30,26 +21,40 @@
#include <boost/config.hpp>
#include <boost/utility/enable_if.hpp>
-#include <boost/assign/v2/detail/config/limit_arity.hpp>
-#include <boost/assign/v2/detail/pp/args.hpp>
-#include <boost/assign/v2/detail/pp/params.hpp>
-#include <boost/assign/v2/detail/pp/seq.hpp>
-
-#include <boost/assign/v2/detail/functor/crtp_unary_and_up.hpp>
#include <boost/assign/v2/ref/fusion/assign_copy.hpp>
#include <boost/assign/v2/ref/fusion_matrix/container.hpp>
#include <boost/assign/v2/ref/fusion_matrix/nth_result_of.hpp>
#include <boost/assign/v2/put/compose/tag.hpp>
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#else
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/preprocessor/seq/for_each_product.hpp>
+#include <boost/preprocessor/seq/first_n.hpp>
+#include <boost/assign/v2/detail/functor/crtp_unary_and_up.hpp>
+#include <boost/assign/v2/detail/config/limit_arity.hpp>
+#include <boost/assign/v2/detail/pp/args.hpp>
+#include <boost/assign/v2/detail/pp/params.hpp>
+#include <boost/assign/v2/detail/pp/seq.hpp>
+
+#endif
+
namespace boost{
struct use_default;
-namespace assign{
+namespace assign{
namespace v2{
namespace put_compose_aux{
template<
- typename Pars = boost::mpl::vector0<>,
- typename SeqArgs = boost::mpl::vector0<>,
+ typename Pars = boost::mpl::vector0<>,
+ typename SeqArgs = boost::mpl::vector0<>,
bool enable_pars = (boost::mpl::size<SeqArgs>::value == 0)
>
class composer;
@@ -70,11 +75,15 @@
template<typename Pars, typename SeqArgs, bool enable_pars>
- class composer
+ class composer
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+//do nothing
+#else
: public functor_aux::crtp_unary_and_up<
composer<Pars, SeqArgs, enable_pars>,
composer_result<Pars, SeqArgs, enable_pars>
>
+#endif
{
typedef boost::use_default tag2_;
typedef v2::ref::assign_copy::nth_result_of::fusion<tag2_> meta1_;
@@ -84,20 +93,15 @@
boost::use_default
> meta2_;
- typedef functor_aux::crtp_unary_and_up<
- composer,
- composer_result<Pars, SeqArgs, enable_pars>
- > super_t;
-
public:
BOOST_STATIC_CONSTANT(
- std::size_t,
+ std::size_t,
static_parameters_size = boost::mpl::size<Pars>::value
);
BOOST_STATIC_CONSTANT(
- std::size_t,
+ std::size_t,
static_sequence_args_size = boost::mpl::size<SeqArgs>::value
);
@@ -106,13 +110,13 @@
meta2_,
SeqArgs
>::type seq_args_cont_type;
-
+
composer(){}
composer(
- pars_cont_type const& p,
+ pars_cont_type const& p,
seq_args_cont_type const& s
- )
- : pars_cont( p ),
+ )
+ : pars_cont( p ),
seq_args_cont( s ){}
template<typename T>
@@ -124,7 +128,7 @@
>::type new_;
typedef composer<new_, SeqArgs> type;
};
-
+
template<typename T>
typename boost::lazy_enable_if_c<
enable_pars,
@@ -143,10 +147,8 @@
>
{};
- using super_t::operator();
-
- typename result<
- boost::mpl::vector0<>
+ typename result<
+ boost::mpl::vector0<>
>::type
operator()()const
{
@@ -155,6 +157,36 @@
return result_( this->pars_cont, this->seq_args_cont() );
}
+
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+/*
+ template<typename U, typename ...Args>
+ typename result<
+ boost::mpl::vector<XXX>
+ >::type
+ operator()( U&& u, Args&&...args )const{
+ typedef boost::mpl::vector<XXX> args_;
+ typedef typename result<args_>::type result_;
+ return result_(
+ this->pars_cont,
+ this->seq_args_cont(
+ std::forward<U>( u ),
+ std::forward<Args>( args )...
+ )
+ );
+ }
+*/
+
+#else
+ typedef functor_aux::crtp_unary_and_up<
+ composer,
+ composer_result<Pars, SeqArgs, enable_pars>
+ > super_t;
+ using super_t::operator();
+
+
#define MACRO1( z, n, data ) \
( BOOST_PP_CAT(_,n) ) \
/**/
@@ -182,18 +214,20 @@
#undef MACRO1
#undef MACRO2
- pars_cont_type const& parameters()const{
- return this->pars_cont;
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+ pars_cont_type const& parameters()const{
+ return this->pars_cont;
}
- seq_args_cont_type const& sequence_args()const{
- return this->seq_args_cont;
+ seq_args_cont_type const& sequence_args()const{
+ return this->seq_args_cont;
}
-
+
protected:
-
+
pars_cont_type pars_cont;
seq_args_cont_type seq_args_cont;
-
+
};
}// put_compose_aux
Modified: sandbox/statistics/support/boost/assign/v2/put/generic/crtp.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/put/generic/crtp.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/put/generic/crtp.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -9,24 +9,15 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_PUT_GENERIC_CRTP_ER_2010_HPP
#define BOOST_ASSIGN_V2_PUT_GENERIC_CRTP_ER_2010_HPP
-#include <boost/preprocessor/arithmetic/add.hpp>
-#include <boost/preprocessor/arithmetic/inc.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#include <boost/preprocessor/repeat_from_to.hpp>
#include <boost/mpl/always.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/range/reference.hpp>
-#include <boost/assign/v2/detail/config/limit_csv_arity.hpp>
-#include <boost/assign/v2/detail/config/limit_arity.hpp>
#include <boost/assign/v2/detail/type_traits/container/is_ptr_container.hpp>
#include <boost/assign/v2/detail/functor/functor.hpp>
#include <boost/assign/v2/detail/keyword/keyword.hpp>
-#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
#include <boost/assign/v2/put/modifier/modifier.hpp>
#include <boost/assign/v2/put/generic/result_of_modulo.hpp>
@@ -34,15 +25,21 @@
#include <boost/assign/v2/put/generic/expose_fun.hpp>
#include <boost/assign/v2/put/generic/base.hpp>
-// --------------- //
-// Usage //
-// --------------- //
-// Calling
-// put( v )( a )()( c0, c11 );
-//
-// ----- csv syntax ------
-//
-// put( v )( a )( T() )( T(c0, c11) );
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#else
+#include <boost/preprocessor/arithmetic/add.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repeat_from_to.hpp>
+
+#include <boost/assign/v2/detail/config/limit_csv_arity.hpp>
+#include <boost/assign/v2/detail/config/limit_arity.hpp>
+
+#endif
namespace boost{
namespace assign{
@@ -53,7 +50,9 @@
template<typename V>
struct crtp_traits
{
- typedef typename v2::container_type_traits::value<V>::type value_type;
+ typedef typename v2::container_type_traits::value<
+ V
+ >::type value_type;
typedef typename boost::mpl::eval_if<
container_type_traits::is_ptr_container<V>,
functor_aux::deduce_new_<V>,
@@ -71,12 +70,16 @@
template<typename V,typename F, typename Tag, typename D, typename Traits>
class crtp :
public put_base,
- public put_aux::expose_fun<F>, // protect + friend?
- public put_aux::expose_modifier<Tag>, // protect + friend?
- public functor_aux::crtp_unary_and_up<
+ public put_aux::expose_fun<F> // protect + friend?
+ , public put_aux::expose_modifier<Tag> // protect + friend?
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+//do nothing
+#else
+ , public functor_aux::crtp_unary_and_up<
crtp<V, F, Tag, D, Traits>,
boost::mpl::always< D const& >
>
+#endif
{
public:
@@ -84,34 +87,49 @@
protected:
- typedef functor_aux::crtp_unary_and_up<
- crtp,
- boost::mpl::always<result_type>
- > super_t;
-
typedef expose_modifier<Tag> expose_modifier_;
typedef typename expose_modifier_::modifier_type modifier_;
typedef expose_fun<F> expose_fun_;
-
+
public:
-
+
D & derived(){ return static_cast<D&>(*this); }
D const& derived()const{ return static_cast<D const&>(*this); }
//public:
crtp(){}
- explicit crtp( F const& f ) : expose_fun_( f ){}
- explicit crtp( F const& f, modifier_ const& m )
+ explicit crtp( F const& f ) : expose_fun_( f ){}
+ explicit crtp( F const& f, modifier_ const& m )
: expose_fun_( f ), expose_modifier_( m ){}
- using super_t::operator();
result_type operator()()const
{
return this->arg_deduct( this->fun() );
}
-#define BOOST_ASSIGN_V2_impl(z, N, data) \
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+ template<typename...Args>
+ result_type
+ operator()( Args&&...args )const
+ {
+ return this->arg_deduct(
+ this->fun( std::forward<Args>(args)... )
+ );
+ }
+
+#else
+ protected:
+ typedef functor_aux::crtp_unary_and_up<
+ crtp,
+ boost::mpl::always<result_type>
+ > super_t;
+
+ public:
+ using super_t::operator();
+
+#define MACRO(z, N, data) \
template<BOOST_PP_ENUM_PARAMS(N, typename T)> \
result_type \
impl( BOOST_PP_ENUM_BINARY_PARAMS(N, T, & _) )const \
@@ -122,12 +140,12 @@
BOOST_PP_REPEAT_FROM_TO(
1,
BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_ARITY),
- BOOST_ASSIGN_V2_impl,
+ MACRO,
~
)
-#undef BOOST_ASSIGN_V2_impl
-
- V& unwrap()const{ return this->derived().unwrap(); }
+#undef MACRO
+#endif
+ V& unwrap()const{ return this->derived().unwrap(); }
struct result_of_modulo{
@@ -164,6 +182,17 @@
return this->derived();
}
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+ template<typename T>
+ result_type arg_deduct(T&& t)const
+ {
+ this->modifier.impl(
+ this->derived().unwrap(),
+ std::forward<T>( t )
+ );
+ return this->derived();
+ }
+#else
template<typename T>
result_type arg_deduct(T& t)const
{
@@ -177,6 +206,9 @@
this->modifier.impl( this->derived().unwrap(), t );
return this->derived();
}
+
+#endif
+
};
}// put_aux
Modified: sandbox/statistics/support/boost/assign/v2/put/modifier/at_next.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/put/modifier/at_next.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/put/modifier/at_next.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -13,9 +13,10 @@
#include <boost/assign/v2/put/modifier/def.hpp>
#include <boost/assign/v2/put/generic/new_modifier.hpp>
#include <boost/assign/v2/detail/type_traits/value.hpp>
+#include <boost/assign/v2/detail/pp/forward.hpp>
namespace boost{
-namespace assign{
+namespace assign{
namespace v2{
namespace modifier_tag{ struct at_next{}; }
namespace put_aux{
@@ -26,16 +27,20 @@
modifier():i( 0 ){};
modifier( boost::accumulators::dont_care ):i( 0 ){}
-
+
template<typename V,typename T>
- void impl(V& v, T& t)const{
- v.at( i++ ) = t;
+ void impl(
+ V& v,
+ BOOST_ASSIGN_V2_forward_param(T, t)
+ )const
+ {
+ v.at( i++ ) = BOOST_ASSIGN_V2_forward_arg(T, t);
}
// TODO check
template<typename V,typename T>
void impl(V& v, T* t)const{ v.replace( i++ , t); }
-
+
private:
mutable std::size_t i;
};
Modified: sandbox/statistics/support/boost/assign/v2/put/modifier/incr_lookup.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/put/modifier/incr_lookup.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/put/modifier/incr_lookup.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -14,6 +14,7 @@
#include <boost/assign/v2/put/modifier/def.hpp>
#include <boost/assign/v2/detail/type_traits/value.hpp>
#include <boost/assign/v2/detail/functor/identity.hpp>
+#include <boost/assign/v2/detail/pp/forward.hpp>
#include <boost/assign/v2/put/generic/new_fun.hpp>
#include <boost/assign/v2/put/generic/new_modifier.hpp>
#include <boost/assign/v2/put/generic/result_of_modulo.hpp>
@@ -22,7 +23,7 @@
// TODO fix compile errors using put adaptor.
namespace boost{
-namespace assign{
+namespace assign{
namespace v2{
// lookup_key
@@ -35,12 +36,12 @@
modifier():n( 0 ){}
modifier(std::size_t m):n( m ){};
-
+
template<typename V,typename T>
- void impl(V& v, T& t)const{
- v[ t ] += this->n;
+ void impl(V& v, BOOST_ASSIGN_V2_forward_param(T, t) )const{
+ v[ BOOST_ASSIGN_V2_forward_arg(T, t) ] += this->n;
}
-
+
private:
std::size_t n;
};
@@ -50,8 +51,8 @@
modulo_incr_lookup() : n( 1 ){}
modulo_incr_lookup(std::size_t m) : n( m ){}
- modulo_incr_lookup
- operator=(std::size_t m)const{
+ modulo_incr_lookup
+ operator=(std::size_t m)const{
typedef modulo_incr_lookup result_;
return result_( m );
}
@@ -73,7 +74,7 @@
typedef v2::modifier_tag::incr_lookup new_tag_;
typedef put_aux::modifier<new_tag_> modifier_;
-
+
static type call(const T& t, put_aux::modulo_incr_lookup const& kwd)
{
return type( t.unwrap(), _identity, kwd.n );
@@ -97,7 +98,7 @@
}// put_aux
namespace{
- put_aux::modulo_incr_lookup const _incr_lookup
+ put_aux::modulo_incr_lookup const _incr_lookup
= put_aux::modulo_incr_lookup();
}
}// v2
Modified: sandbox/statistics/support/boost/assign/v2/put/modifier/repeat.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/put/modifier/repeat.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/put/modifier/repeat.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -16,12 +16,13 @@
#include <boost/assign/v2/put/generic/base.hpp>
#include <boost/assign/v2/put/generic/new_modifier.hpp>
#include <boost/assign/v2/ref/wrapper/copy.hpp>
+#include <boost/assign/v2/detail/pp/forward.hpp>
namespace boost{
-namespace assign{
+namespace assign{
namespace v2{
-namespace modifier_tag{
- template<typename Tag> struct repeat{};
+namespace modifier_tag{
+ template<typename Tag> struct repeat{};
}// modifier_tag
namespace put_aux{
@@ -43,13 +44,18 @@
modifier(){}
explicit modifier( size_type const& n ):super_t( n ){};
-
+
template<typename V,typename T>
- void impl(V& v, T& t)const{
+ void impl(V& v, BOOST_ASSIGN_V2_forward_param(T, t) )
+ const{
+
size_type m = static_cast<super_t const&>(*this).unwrap();
- while(m--) this->inner.impl( v, t );
+ while(m--) this->inner.impl(
+ v,
+ BOOST_ASSIGN_V2_forward_arg(T, t)
+ );
}
-
+
private:
inner_ inner;
};
@@ -65,7 +71,7 @@
> super_t;
public:
-
+
typedef std::size_t size_type;
modulo_repeat(){}
@@ -76,17 +82,17 @@
modulo_repeat result( n );
return result;
}
-
+
size_type const& unwrap()const
- {
+ {
return static_cast<super_t const&>(*this).unwrap();
}
-
+
};
}// put_aux
namespace result_of_modulo{
-
+
template<typename T>
struct repeat
{
@@ -97,17 +103,17 @@
result_of_modulo::new_modifier<T>,
new_tag_
>::type type;
-
+
static type call(const T& t, put_aux::modulo_repeat const& h)
{
modifier_ m( h.unwrap() );
- return type( t.unwrap(), t.fun, m );
+ return type( t.unwrap(), t.fun, m );
}
-
+
};
}// result_of_modulo
-namespace put_aux{
+namespace put_aux{
template<typename T>
typename boost::lazy_enable_if<
@@ -115,10 +121,10 @@
result_of_modulo::repeat<T>
>::type
operator%(
- T const& t,
+ T const& t,
put_aux::modulo_repeat const& h
)
- {
+ {
typedef result_of_modulo::repeat<T> caller_;
return caller_::call( t, h );
}
Modified: sandbox/statistics/support/boost/assign/v2/put/modifier/xxx.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/put/modifier/xxx.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/put/modifier/xxx.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -8,8 +8,11 @@
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_PUT_MODIFIER_XXX
+
#include <boost/preprocessor/cat.hpp>
#include <boost/accumulators/framework/accumulator_base.hpp>
+
+#include <boost/assign/v2/detail/pp/forward.hpp>
#include <boost/assign/v2/put/modifier/def.hpp>
#include <boost/assign/v2/put/generic/new_modifier.hpp>
@@ -24,11 +27,15 @@
struct modifier<v2::modifier_tag::FUN>\
{\
\
- modifier(){}\
+ modifier(){}\
modifier( boost::accumulators::dont_care ){}\
\
template<typename V, typename T>\
- void impl(V& v, T& t)const{ v.FUN( t ); }\
+ void impl(V& v, BOOST_ASSIGN_V2_forward_param(T, t) )const{\
+ v.FUN(\
+ BOOST_ASSIGN_V2_forward_arg(T, t)\
+ );\
+ }\
\
template<typename V, typename T>\
void impl(V& v, T* t)const{ v.FUN( t ); }\
@@ -51,8 +58,3 @@
#endif
-/*
-
-*/
-
-
Modified: sandbox/statistics/support/boost/assign/v2/put/sub/csv.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/put/sub/csv.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/put/sub/csv.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -13,15 +13,22 @@
#include <boost/assign/v2/ref/wrapper/copy.hpp>
#include <boost/assign/v2/detail/type_traits/container/value.hpp>
#include <boost/assign/v2/put/sub/make.hpp>
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#else
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/assign/v2/detail/config/limit_arity.hpp>
+#endif
namespace boost{
namespace assign{
namespace v2{
namespace csv_put_aux{
- template<typename V>
- class sub
- : protected ref::wrapper<
+ template<typename V>
+ class sub
+ : protected ref::wrapper<
ref::assign_tag::copy,
V
>
@@ -32,13 +39,45 @@
typedef ref::assign_tag::copy assign_tag_;
typedef ref::wrapper<assign_tag_,V> super1_t;
- typedef typename v2::container_type_traits::value<V>::type value_type;
+ typedef typename v2::container_type_traits::value<
+ V
+ >::type value_type;
public:
sub(){}
explicit sub( V& v ) : super1_t( v ) {}
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+ protected:
+ template<typename R>
+ void impl(R& r){}
+
+ template<typename R,typename... Args>
+ //implicit conversion to value_type desired
+ // TODO make sure it is achieved.
+ void impl(R& r, value_type const& t, Args&&...args)
+ {
+ r( t );
+ this->impl( r, std::forward<Args>( args )... );
+ }
+
+ public:
+ template<typename... Args>
+ typename result_of::put<V>::type
+ operator()(Args&&...args)
+ {
+ typedef typename result_of::put<V>::type result_;
+ result_ result = put( this->unwrap() );
+ this->impl(
+ result,
+ args...
+ );
+ return result;
+ }
+
+#else
#define MACRO1(z, i, data) ( BOOST_PP_CAT(_, i) )
#define MACRO2(z, N, data)\
typename result_of::put<V>::type\
@@ -48,16 +87,16 @@
}\
/**/
BOOST_PP_REPEAT_FROM_TO(
- 1,
+ 1,
BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_CSV_ARITY),
MACRO2,
~
)
#undef MACRO1
-#undef MACRO2
-
- V& unwrap()const{
- return static_cast<super1_t const&>(*this).unwrap();
+#undef MACRO2
+#endif
+ V& unwrap()const{
+ return static_cast<super1_t const&>(*this).unwrap();
}
};
@@ -70,7 +109,7 @@
{
typedef csv_put_aux::sub<V> type;
};
-
+
}// result_of
template<typename V>
Modified: sandbox/statistics/support/boost/assign/v2/ref/anon/csv/assign_copy.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/ref/anon/csv/assign_copy.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/ref/anon/csv/assign_copy.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -12,8 +12,7 @@
#include <boost/assign/v2/ref/wrapper/copy.hpp>
#include <boost/assign/v2/ref/anon/csv/assign_xxx.hpp>
-#define xxx_Tag1 assign_tag::copy
-BOOST_ASSIGN_V2_REF_CSV_ARRAY_ASSIGN_XXX( assign_copy )
-#undef xxx_Tag1
+BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_1( assign_copy, assign_tag::copy )
+BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_2( assign_copy, assign_tag::copy )
#endif
Modified: sandbox/statistics/support/boost/assign/v2/ref/anon/csv/assign_rebind.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/ref/anon/csv/assign_rebind.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/ref/anon/csv/assign_rebind.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -12,8 +12,17 @@
#include <boost/assign/v2/ref/wrapper/rebind.hpp>
#include <boost/assign/v2/ref/anon/csv/assign_xxx.hpp>
-#define xxx_Tag1 assign_tag::rebind
-BOOST_ASSIGN_V2_REF_CSV_ARRAY_ASSIGN_XXX( assign_rebind )
-#undef xxx_Tag1
+//#define xxx_Tag1 assign_tag::rebind
+//BOOST_ASSIGN_V2_REF_CSV_ARRAY_ASSIGN_XXX( assign_rebind )
+//#undef xxx_Tag1
+
+BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_1(
+ assign_rebind,
+ assign_tag::rebind
+)
+BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_2(
+ assign_rebind,
+ assign_tag::rebind
+)
#endif
Modified: sandbox/statistics/support/boost/assign/v2/ref/anon/csv/assign_xxx.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/ref/anon/csv/assign_xxx.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/ref/anon/csv/assign_xxx.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -7,51 +7,120 @@
// 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/preprocessor/arithmetic/inc.hpp>
-#include <boost/preprocessor/repetition/repeat_from_to.hpp>
-#include <boost/assign/v2/detail/config/limit_csv_arity.hpp>
+#ifndef BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_ER_2010_HPP
+#define BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_ER_2010_HPP
+
#include <boost/assign/v2/ref/anon/csv/nth_result_of.hpp>
#include <boost/assign/v2/ref/anon/csv/make.hpp>
-#include <boost/assign/v2/ref/anon/csv/pp.hpp>
-
+// Associate a nested namespace with an assign tag.
// Usage:
-// #define xxx_Tag1 name
-// BOOST_ASSIGN_V2_REF_CSV_ARRAY_ASSIGN_XXX( ns )
-// #undef xxx_Tag1
-
-#ifndef BOOST_ASSIGN_V2_REF_CSV_ARRAY_iter
-#define BOOST_ASSIGN_V2_REF_CSV_ARRAY_iter( z, n, data ) \
- BOOST_ASSIGN_V2_REF_CSV_ARRAY_tpl( T , n, 0, xxx_Tag1 ) \
- BOOST_ASSIGN_V2_REF_CSV_ARRAY_tpl( T const, n, 0, xxx_Tag1 ) \
-/**/
-#endif
-#ifndef BOOST_ASSIGN_V2_REF_CSV_ARRAY_ASSIGN_XXX
-#define BOOST_ASSIGN_V2_REF_CSV_ARRAY_ASSIGN_XXX( NS ) \
+// BOOST_ASSIGN_V2_REF_CSV_ARRAY_ASSIGN_XXX_1( NS, TAG )
+// BOOST_ASSIGN_V2_REF_CSV_ARRAY_ASSIGN_XXX_2( NS, TAG )
+
+#ifndef BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_1
+#define BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_1( NS, TAG ) \
namespace boost{ \
namespace assign{ \
namespace v2{ \
namespace ref{ \
namespace NS{ \
namespace nth_result_of{ \
- template<std::size_t N,typename T> \
- struct csv_anon : ref::nth_result_of::csv_anon<N, xxx_Tag1, T>{};\
+ template<std::size_t N, typename T> \
+ struct csv_anon : ref::nth_result_of::csv_anon<N, TAG, T>{};\
} \
template<typename T>\
- typename ref::result_of::empty_csv_anon<xxx_Tag1, T>::type\
+ typename ref::result_of::empty_csv_anon<TAG, T>::type\
csv_anon( keyword_aux::nil )\
{\
typedef typename ref::result_of::empty_csv_anon<\
- xxx_Tag1,\
+ TAG,\
T\
>::type result_;\
return result_();\
}\
+} \
+} \
+} \
+} \
+} \
+/**/
+
+#endif // BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_1
+
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+
+#ifndef BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_M
+#define BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_M(NS, TAG, U, Brgs)\
+ template<typename T,typename...Args>\
+ typename csv_anon_aux::result<TAG, U, Brgs...>::type\
+ csv_anon( U& u, Brgs&...args )\
+ {\
+ typedef csv_anon_aux::result<TAG, U, Brgs...> caller_;\
+ return caller_::call( u, args... );\
+ }\
+/**/
+
+#endif // BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_M
+
+#ifndef BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_2(NS, TAG)
+#define BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_2(NS, TAG)\
+namespace boost{ \
+namespace assign{ \
+namespace v2{ \
+namespace ref{ \
+namespace NS{ \
+BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_M(NS, TAG, T, Args)\
+BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_M(NS, TAG, T const, Args const)\
+} \
+} \
+} \
+} \
+} \
+/**/
+#endif // BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_2
+
+#else
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/assign/v2/detail/config/limit_csv_arity.hpp>
+//#include <boost/assign/v2/ref/anon/csv/pp.hpp>
+
+#ifndef BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_M1
+#define BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_M1(n, U, TAG)\
+ template<typename T>\
+ typename nth_result_of::csv_anon<\
+ n,\
+ U\
+ >::type\
+ csv_anon( BOOST_PP_ENUM_PARAMS(n, U& _) )\
+ {\
+ return ref::csv_anon<TAG>( BOOST_PP_ENUM_PARAMS(n, _) );\
+ }\
+/**/
+#endif
+
+#ifndef BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_M2
+#define BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_M2(z, n, TAG)\
+BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_M1(n, T, TAG)\
+BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_M1(n, T const, TAG)\
+/**/
+#endif
+
+#ifndef BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_2
+#define BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_2( NS, TAG ) \
+namespace boost{ \
+namespace assign{ \
+namespace v2{ \
+namespace ref{ \
+namespace NS{ \
BOOST_PP_REPEAT_FROM_TO( \
1, \
BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_CSV_ARITY), \
- BOOST_ASSIGN_V2_REF_CSV_ARRAY_iter, \
- ~ \
+ BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_M2, \
+ TAG \
) \
} \
} \
@@ -60,4 +129,8 @@
} \
/**/
-#endif
+#endif // BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_2
+
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+#endif // BOOST_ASSIGN_V2_REF_ANON_CSV_ASSIGN_XXX_ER_2010_HPP
Modified: sandbox/statistics/support/boost/assign/v2/ref/anon/csv/make.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/ref/anon/csv/make.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/ref/anon/csv/make.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -9,18 +9,22 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_REF_CONTAINER_ANON_CSV_MAKE_ER_2010_HPP
#define BOOST_ASSIGN_V2_REF_CONTAINER_ANON_CSV_MAKE_ER_2010_HPP
-#include <boost/preprocessor/arithmetic/inc.hpp>
-#include <boost/preprocessor/repeat_from_to.hpp>
#include <boost/assign/v2/detail/keyword/nil.hpp>
-#include <boost/assign/v2/detail/config/limit_csv_arity.hpp>
-#include <boost/assign/v2/detail/config/limit_arity.hpp>
+#include <boost/assign/v2/ref/static_array/alloc/fast_alloc.hpp>
#include <boost/assign/v2/ref/anon/csv/nth_result_of.hpp>
-#include <boost/assign/v2/ref/anon/csv/pp.hpp>
-
-// Usage
-// using namespace boost::assign::v2::ref::csv;
-// csv_anon<assign_tag::name>( a, b, c );
-
+
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#include <boost/config.hpp>
+#else
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/assign/v2/detail/config/limit_csv_arity.hpp>
+#endif
+
namespace boost{
namespace assign{
namespace v2{
@@ -28,9 +32,9 @@
namespace result_of{
template<typename Tag1,typename T>
- struct empty_csv_anon
+ struct empty_csv_anon
: nth_result_of::csv_anon<0, Tag1, T>{};
-
+
}// result_of
template<typename Tag1, typename T>
@@ -41,9 +45,88 @@
return result_();
}
-#define MACRO( z, n, data )\
- BOOST_ASSIGN_V2_REF_CSV_ARRAY_tpl(T , n, 1, Tag1 ) \
- BOOST_ASSIGN_V2_REF_CSV_ARRAY_tpl(T const, n, 1, Tag1 ) \
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+namespace csv_anon_aux{
+
+ template<std::size_t n,typename U,typename R>
+ void assign(R& r){}
+
+ template<std::size_t n, typename U, typename R, typename... Args>
+ void assign(R& r, U& u, Args&...args)
+ {
+ typedef typename R::wrapper_type wrapper_;
+ r.get_wrapper( n ) = wrapper_( u );
+ csv_anon_aux::assign<n + 1, U>(r, args...);
+ }
+
+ template<typename Tag1, typename U, typename... Args>
+ struct result
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, n = 1 + sizeof...(Args) );
+ typedef typename nth_result_of::csv_anon<
+ n,
+ Tag1,
+ U
+ >::type type;
+
+ static type call(U& u, Args&...args)
+ {
+ type result;
+ csv_anon_aux::assign<0, U>(result, u, args...);
+ return result;
+ }
+
+ };
+
+}// csv_anon_aux
+
+#define MACRO(U, Brgs)\
+ template<typename Tag1,typename T,typename...Args>\
+ typename csv_anon_aux::result<Tag1, U, Brgs...>::type\
+ csv_anon( U& u, Brgs&...args )\
+ {\
+ typedef csv_anon_aux::result<Tag1, U, Brgs...> caller_;\
+ return caller_::call( u, args... );\
+ }\
+/**/
+MACRO(T, Args)
+MACRO(T const, Args const)
+#undef MACRO
+
+#else
+
+ template<std::size_t i, typename U, typename R>
+ void assign(R& r, U& u)
+ {
+ typedef typename R::wrapper_type wrapper_;
+ r.get_wrapper( i ) = wrapper_( u );
+ }
+
+#define MACRO1(z, i, U) assign<i, U>( r, BOOST_PP_CAT(_,i) );
+#define MACRO2(z, n, U)\
+ template<typename Tag1, typename T>\
+ typename nth_result_of::csv_anon<\
+ n,\
+ Tag1,\
+ U\
+ >::type\
+ csv_anon( BOOST_PP_ENUM_PARAMS(n, U& _) ) \
+ {\
+ typedef typename nth_result_of::csv_anon<\
+ n,\
+ Tag1,\
+ U\
+ >::type result_;\
+ result_ r;\
+ BOOST_PP_REPEAT( n, MACRO1, U )\
+ return r;\
+ }\
+/**/
+
+#define MACRO(z, n, data)\
+MACRO2(z, n, T)\
+MACRO2(z, n, T const)\
/**/
BOOST_PP_REPEAT_FROM_TO(
@@ -52,8 +135,10 @@
MACRO,
~
)
-
+#undef MACRO1
+#undef MACRO2
#undef MACRO
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
}// ref
}// v2
Modified: sandbox/statistics/support/boost/assign/v2/ref/anon/csv/pp.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/ref/anon/csv/pp.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/ref/anon/csv/pp.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -1,62 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to 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_ASSIGN_V2_REF_CONTAINER_ANON_CSV_PP_ER_2010_HPP
-#define BOOST_ASSIGN_V2_REF_CONTAINER_ANON_CSV_PP_ER_2010_HPP
-#include <boost/preprocessor/repeat.hpp>
-#include <boost/preprocessor/enum_params.hpp>
-#include <boost/preprocessor/expr_if.hpp>
-#include <boost/preprocessor/comma_if.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/assign/v2/detail/config/limit_arity.hpp>
-#include <boost/assign/v2/detail/keyword/nil.hpp>
-#include <boost/assign/v2/ref/fusion/make.hpp>
-#include <boost/assign/v2/ref/static_array/alloc/fast_alloc.hpp>
-#include <boost/assign/v2/ref/anon/csv/nth_result_of.hpp>
-
-//#define BOOST_ASSIGN_V2_REF_CSV_ARRAY_invoke(z,n,data) \
-// ( BOOST_PP_CAT(_,n) ) \
-///**/
-
-#define BOOST_ASSIGN_V2_REF_CSV_ARRAY_invoke(z, n, data) \
- result.get_wrapper( n ) = wrapper_( BOOST_PP_CAT(_,n) ); \
-/**/
-
-#define BOOST_ASSIGN_V2_REF_CSV_ARRAY_tpl(U, N, param, Tag1) \
- template<BOOST_PP_EXPR_IF(param, typename Tag1) \
- BOOST_PP_COMMA_IF(param) typename T> \
- typename nth_result_of::csv_anon< \
- N, \
- BOOST_PP_EXPR_IF(param, Tag1) BOOST_PP_COMMA_IF(param) \
- U \
- >::type \
- csv_anon( BOOST_PP_ENUM_PARAMS(N, U& _) ) \
- { \
- typedef typename nth_result_of::csv_anon< \
- N, \
- BOOST_PP_EXPR_IF(param, Tag1) BOOST_PP_COMMA_IF(param) \
- U \
- >::type result_; typedef typename result_::wrapper_type wrapper_;\
- result_ result;\
- BOOST_PP_REPEAT( N, BOOST_ASSIGN_V2_REF_CSV_ARRAY_invoke, ~ )\
- return result;\
- } \
-/**/
-
-// Old impelementation:
-// typedef anon_aux::csv_tag2_ tag2_; \
-// return ref::fusion< \
-// Tag1, \
-// tag2_, \
-// U \
-// >( v2::_nil ) \
-// BOOST_PP_REPEAT( N, BOOST_ASSIGN_V2_REF_CSV_ARRAY_invoke, ~ ) ; \
-
-#endif
-
+// TODO remove file
Modified: sandbox/statistics/support/boost/assign/v2/ref/fusion_matrix/container.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/ref/fusion_matrix/container.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/ref/fusion_matrix/container.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -9,6 +9,26 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_REF_FUSION_MATRIX_CONTAINER_ER_2010_HPP
#define BOOST_ASSIGN_V2_REF_FUSION_MATRIX_CONTAINER_ER_2010_HPP
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/unpack_args.hpp>
+//#include <boost/mpl/aux_/na.hpp>
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/minus.hpp>
+#include <boost/mpl/size.hpp>
+#include <boost/mpl/vector.hpp>
+
+#include <boost/utility/enable_if.hpp>
+
+#include <boost/assign/v2/ref/wrapper/framework.hpp>
+#include <boost/assign/v2/ref/fusion/link_holder.hpp>
+#include <boost/assign/v2/ref/fusion_matrix/fwd.hpp>
+
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+
+#else
+
#include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/punctuation/comma.hpp>
@@ -19,24 +39,16 @@
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#include <boost/preprocessor/repetition/enum_trailing.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
+#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
-
-#include <boost/mpl/apply.hpp>
-#include <boost/mpl/unpack_args.hpp>
#include <boost/mpl/aux_/na.hpp>
-#include <boost/mpl/int.hpp>
-#include <boost/mpl/minus.hpp>
-#include <boost/mpl/size.hpp>
-#include <boost/mpl/vector.hpp>
-
-#include <boost/utility/enable_if.hpp>
-
+#include <boost/mpl/eval_if.hpp>
+#include <boost/tuple/tuple.hpp>
#include <boost/assign/v2/detail/config/limit_arity.hpp>
#include <boost/assign/v2/detail/functor/crtp_unary_and_up.hpp>
-#include <boost/assign/v2/ref/wrapper/framework.hpp>
-#include <boost/assign/v2/ref/fusion/link_holder.hpp>
-#include <boost/assign/v2/ref/fusion_matrix/fwd.hpp>
+
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
namespace boost{
struct use_default;
@@ -45,8 +57,34 @@
namespace ref{
namespace fusion_matrix_aux{
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+ template<
+ std::size_t N, typename L, typename Tag1, typename Tag2,
+ typename...Args
+ >
+ struct meta_result{
+
+ typedef fusion_matrix_aux::container<N, L, Tag1, Tag2,
+ Args...> this_;
+
+ template<typename ... NewArgs>
+ struct apply
+ {
+
+ typedef fusion_matrix_aux::container<
+ N + 1,
+ this_,
+ Tag1,
+ Tag2,
+ typename wrapper_param<NewArgs>::type...
+ > type;
+
+ };
+
+ };
+#else
template<
- std::size_t N, typename L, typename Tag1, typename Tag2,
+ std::size_t N, typename L, typename Tag1, typename Tag2,
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
BOOST_ASSIGN_V2_LIMIT_ARITY,
typename T,
@@ -55,11 +93,10 @@
>
struct meta_result{
- typedef fusion_matrix_aux::container<N, L, Tag1, Tag2,
+ typedef fusion_matrix_aux::container<N, L, Tag1, Tag2,
BOOST_PP_ENUM_PARAMS(BOOST_ASSIGN_V2_LIMIT_ARITY, T)
> this_;
-
template<
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
BOOST_ASSIGN_V2_LIMIT_ARITY,
@@ -71,12 +108,12 @@
{
typedef fusion_matrix_aux::container<
- N+1,
- this_,
- Tag1,
- Tag2,
+ N + 1,
+ this_,
+ Tag1,
+ Tag2,
BOOST_PP_ENUM_PARAMS(
- BOOST_ASSIGN_V2_LIMIT_ARITY,
+ BOOST_ASSIGN_V2_LIMIT_ARITY,
U
)
> type;
@@ -85,31 +122,41 @@
};
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
template<
- std::size_t N, typename L, typename Tag1, typename Tag2,
+ std::size_t N, typename L, typename Tag1, typename Tag2,
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+ typename... Args
+#else
BOOST_PP_ENUM_PARAMS(
- BOOST_ASSIGN_V2_LIMIT_ARITY,
+ BOOST_ASSIGN_V2_LIMIT_ARITY,
typename T
)
+#endif
>
- class container
- : public fusion_aux::link_holder<L, N == 0>,
- public functor_aux::crtp_unary_and_up<
+ class container
+ : public fusion_aux::link_holder<L, N == 0>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+// do nothing
+#else
+ , public functor_aux::crtp_unary_and_up<
fusion_matrix_aux::container<N, L, Tag1, Tag2,
BOOST_PP_ENUM_PARAMS(
- BOOST_ASSIGN_V2_LIMIT_ARITY,
+ BOOST_ASSIGN_V2_LIMIT_ARITY,
T
- )
- >,
- boost::mpl::unpack_args<
+ )
+ >
+ , boost::mpl::unpack_args<
fusion_matrix_aux::meta_result<N, L, Tag1, Tag2,
BOOST_PP_ENUM_PARAMS(
- BOOST_ASSIGN_V2_LIMIT_ARITY,
+ BOOST_ASSIGN_V2_LIMIT_ARITY,
T
- )
+ )
>
>
>
+#endif
{
typedef boost::mpl::int_<0> int0_;
@@ -120,56 +167,106 @@
template<typename T>
struct wrapper{ typedef ref::wrapper<assign_tag_,T> type; };
-
+
typedef fusion_aux::link_holder<L, N == 0> link_;
typedef fusion_matrix_aux::meta_result<N, L, Tag1, Tag2,
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+ Args...
+#else
BOOST_PP_ENUM_PARAMS(
- BOOST_ASSIGN_V2_LIMIT_ARITY,
+ BOOST_ASSIGN_V2_LIMIT_ARITY,
T
- )
+ )
+#endif
> meta_result_;
- typedef functor_aux::crtp_unary_and_up<
- container,
- boost::mpl::unpack_args<
- meta_result_
- >
- > super_t;
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+// do nothing
+#else
+ typedef boost::mpl::na na_;
+ typedef boost::tuples::null_type null_;
typedef boost::mpl::vector<
BOOST_PP_ENUM_PARAMS(BOOST_ASSIGN_V2_LIMIT_ARITY, T)
> vec_;
+ template<typename T>
+ struct tuple_elem : boost::mpl::eval_if<
+ boost::is_same<T, na_>,
+ boost::mpl::identity<null_>,
+ wrapper<T>
+ >{};
+
+
+#define MACRO(z, n, data) typename tuple_elem<BOOST_PP_CAT(T,n)>::type
+
+ typedef boost::tuples::tuple<
+ BOOST_PP_ENUM(
+ BOOST_ASSIGN_V2_LIMIT_ARITY,
+ MACRO,
+ ~
+ )
+ > tuple_;
+#undef MACRO
+
+#endif
+
+ tuple_ tuple;
+
public:
typedef std::size_t size_type;
BOOST_STATIC_CONSTANT(size_type, static_row_size = N);
- BOOST_STATIC_CONSTANT(size_type,
- static_column_size = boost::mpl::size<vec_>::value
+ BOOST_STATIC_CONSTANT(size_type,
+ static_column_size =
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+ sizeof...(Args)
+#else
+ boost::mpl::size<vec_>::value
+#endif
);
container(){}
-
-#define MACRO1(z, n, data)\
- BOOST_PP_CAT(w, n) ( BOOST_PP_CAT(_, n) )\
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+ explicit container(
+ const L& l, Args&...args
+ ) : link_( l ), tuple( ref::wrap<assign_tag_>(args)... )
+
+// w... = args...
+ {}
+
+#else
+//#define MACRO1(z, n, data)\
+// BOOST_PP_CAT(w, n) ( BOOST_PP_CAT(_, n) )\
/**/
-#define MACRO2(z, n, data) \
+#define MACRO1(z, n, data) ref::wrap<assign_tag_>( BOOST_PP_CAT(data, n) )
+#define MACRO(z, n, data) \
explicit container( \
- const L& l BOOST_PP_COMMA_IF(n) \
- BOOST_PP_ENUM_BINARY_PARAMS(n, T, & _) \
+ const L& l\
+ BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(n, T, & _)\
) : link_( l )\
- BOOST_PP_ENUM_TRAILING(n, MACRO1, ~)\
+ , tuple( BOOST_PP_ENUM(n, MACRO1, _) )\
{}\
-/**/
+/**/
+
+//#define MACRO2(z, n, data) \
+// explicit container( \
+// const L& l BOOST_PP_COMMA_IF(n) \
+// BOOST_PP_ENUM_BINARY_PARAMS(n, T, & _) \
+// ) : link_( l )\
+// BOOST_PP_ENUM_TRAILING(n, MACRO1, ~)\
+// {}\
+/**/
BOOST_PP_REPEAT(
BOOST_ASSIGN_V2_LIMIT_ARITY,
- MACRO2,
+ MACRO,
~
)
#undef MACRO1
-#undef MACRO2
-
+//#undef MACRO2
+#undef MACRO
+#endif
// ------ operator() ----- //
// adds a row //
// ----------------------- //
@@ -189,14 +286,45 @@
)
>{};
- using super_t::operator();
-
typename result<>::type
operator()()const{
typedef typename result<>::type result_;
return result_( *this );
}
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+ protected:
+ template<typename ... Args>
+ struct cpp0x_helper
+ {
+
+ typedef typename boost::mpl::detail::variadic_vector<
+ Args...
+ >::type args_;
+
+ typedef typename boost::mpl::transform<
+ args_,
+ wrapper_param<boost::mpl::_>
+ >::type params_;
+
+ typedef typename boost::mpl::apply<
+ meta_result_,
+
+ >::type result_;
+
+ };
+
+
+#else
+ typedef functor_aux::crtp_unary_and_up<
+ container,
+ boost::mpl::unpack_args<
+ meta_result_
+ >
+ > super_t;
+ using super_t::operator();
+
#define MACRO1( z, n, data ) \
( BOOST_PP_CAT(_,n) ) \
/**/
@@ -218,13 +346,15 @@
#undef MACRO1
#undef MACRO2
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
// Row extraction
template<int I>
struct is_head : boost::mpl::bool_< I + 1 == N >{};
template<int I>
- struct link_result_static_row
+ struct link_result_static_row
: L::template result_static_row<I>{};
template<int I>
@@ -245,7 +375,7 @@
{
return (*this);
}
-
+
template<int I>
typename boost::lazy_disable_if<
is_head<I>,
@@ -253,13 +383,37 @@
>::type
static_row( boost::mpl::int_<I> index )const
{
- return static_cast<link_ const&>(
- *this
- ).link().static_row( index );
+ return static_cast<link_ const&>(
+ *this
+ ).link().static_row( index );
}
// Column extraction
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+// TODO
+#else
+
+ template<int n>
+ struct static_column_result
+ {
+ typedef typename boost::tuples::element<
+ n,
+ tuple_
+ >::type wrapper_;
+ typedef typename wrapper_::unwrap_type type;
+ };
+
+ template<int n>
+ typename static_column_result<n>::type
+ static_column( boost::mpl::int_<n> )const
+ {
+ return boost::get<n>( this->tuple ).unwrap();
+ }
+
+// TODO remove
+// Prior to 11/2010:
+/*
#define MACRO(z, n, data)\
private: \
typename wrapper<BOOST_PP_CAT(T,n)>::type BOOST_PP_CAT(w,n); \
@@ -268,13 +422,16 @@
{\
return this->BOOST_PP_CAT(w,n).unwrap(); \
}\
-/**/
BOOST_PP_REPEAT(
BOOST_ASSIGN_V2_LIMIT_ARITY,
MACRO,
~
)
#undef MACRO
+*/
+/**/
+
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
};
@@ -284,5 +441,5 @@
}// assign
}// boost
-#endif
+#endif // BOOST_ASSIGN_V2_REF_FUSION_MATRIX_CONTAINER_ER_2010_HPP
Modified: sandbox/statistics/support/boost/assign/v2/ref/fusion_matrix/fwd.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/ref/fusion_matrix/fwd.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/ref/fusion_matrix/fwd.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -9,10 +9,15 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_REF_FUSION_MATRIX_FWD_ER_2010_HPP
#define BOOST_ASSIGN_V2_REF_FUSION_MATRIX_FWD_ER_2010_HPP
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+// do nothing
+#else
#include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#include <boost/mpl/aux_/na.hpp>
#include <boost/assign/v2/detail/config/limit_arity.hpp>
+#endif
namespace boost{
namespace assign{
@@ -20,8 +25,18 @@
namespace ref{
namespace fusion_matrix_aux{
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+ template<
+ std::size_t N, typename L,typename Tag1, typename Tag2,
+ typename...Args
+ >
+ class container;
+
+#else
+
template<
- std::size_t N, typename L,typename Tag1, typename Tag2,
+ std::size_t N, typename L,typename Tag1, typename Tag2,
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
BOOST_ASSIGN_V2_LIMIT_ARITY,
typename T,
@@ -29,8 +44,9 @@
)
>
class container;
+#endif
-}// fusion_matrix_aux
+}// fusion_matrix_aux
}// ref
}// v2
}// assign
Modified: sandbox/statistics/support/boost/assign/v2/ref/wrapper/base.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/ref/wrapper/base.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/ref/wrapper/base.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -8,7 +8,7 @@
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
//////////////////////////////////////////////////////////////////////////////
-#ifndef BOOST_ASSIGN_V2_REF_WRAPPER_BASE
+#ifndef BOOST_ASSIGN_V2_REF_WRAPPER_BASE
#include <boost/config.hpp>
#include <boost/type_traits/is_const.hpp>
template<typename D, typename T>
@@ -30,6 +30,7 @@
this->ref_ = &r; \
} \
\
+ typedef T& unwrap_type;\
T& unwrap() const \
{ \
return *this->ref_; \
Modified: sandbox/statistics/support/boost/assign/v2/ref/wrapper/framework.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/ref/wrapper/framework.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/ref/wrapper/framework.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -37,7 +37,7 @@
}
template<typename Tag, typename T>
-inline ref::wrapper<Tag,T const>
+inline ref::wrapper<Tag, T const>
wrap(T const & t)
{
typedef ref::wrapper<Tag,T const> result_;
Modified: sandbox/statistics/support/boost/assign/v2/ref/wrapper/wrapper.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/ref/wrapper/wrapper.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/ref/wrapper/wrapper.hpp 2010-11-18 12:16:05 EST (Thu, 18 Nov 2010)
@@ -13,5 +13,6 @@
#include <boost/assign/v2/ref/wrapper/deduce_assign_tag.hpp>
#include <boost/assign/v2/ref/wrapper/copy.hpp>
#include <boost/assign/v2/ref/wrapper/rebind.hpp>
+#include <boost/assign/v2/ref/wrapper/cpp0x.hpp>
#endif
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk