|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r64709 - in sandbox/statistics/support/boost/assign/v2: . detail/checking detail/functor detail/fwd detail/type_traits/container put/modifier put/wrapper
From: erwann.rogard_at_[hidden]
Date: 2010-08-09 17:15:06
Author: e_r
Date: 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
New Revision: 64709
URL: http://svn.boost.org/trac/boost/changeset/64709
Log:
minor modif of existing files
Text files modified:
sandbox/statistics/support/boost/assign/v2/detail/checking/container.hpp | 11 +++++++
sandbox/statistics/support/boost/assign/v2/detail/checking/deduce_check.hpp | 13 ++++++++-
sandbox/statistics/support/boost/assign/v2/detail/functor/constructor.hpp | 1
sandbox/statistics/support/boost/assign/v2/detail/functor/functor.hpp | 1
sandbox/statistics/support/boost/assign/v2/detail/fwd/container.hpp | 7 +++-
sandbox/statistics/support/boost/assign/v2/detail/fwd/fwd.hpp | 1
sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/container.hpp | 10 ++++++
sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/has_static_size.hpp | 4 +++
sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_fifo.hpp | 14 +++++++++-
sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_lifo.hpp | 13 ++++++++-
sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_map.hpp | 16 ++++++++---
sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_sorted.hpp | 14 ++++++++--
sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_static_array.hpp | 9 ++++++
sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/value.hpp | 18 ++++++++++---
sandbox/statistics/support/boost/assign/v2/put/modifier/at_next.hpp | 4 +++
sandbox/statistics/support/boost/assign/v2/put/modifier/deduce.hpp | 6 ++--
sandbox/statistics/support/boost/assign/v2/put/modifier/push_back.hpp | 8 ++++-
sandbox/statistics/support/boost/assign/v2/put/wrapper/crtp.hpp | 52 +++++++++++++++++++--------------------
sandbox/statistics/support/boost/assign/v2/put/wrapper/make.hpp | 10 +++---
sandbox/statistics/support/boost/assign/v2/v2.hpp | 1
20 files changed, 151 insertions(+), 62 deletions(-)
Modified: sandbox/statistics/support/boost/assign/v2/detail/checking/container.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/checking/container.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/checking/container.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -10,9 +10,10 @@
#ifndef BOOST_ASSIGN_V2_CHECKING_CONTAINER_ER_2010_HPP
#define BOOST_ASSIGN_V2_CHECKING_CONTAINER_ER_2010_HPP
#include <boost/assign/v2/detail/checking/deduce_check.hpp>
+#include <boost/assign/v2/detail/checking/array.hpp>
#include <boost/assign/v2/detail/checking/fifo.hpp>
#include <boost/assign/v2/detail/checking/lifo.hpp>
-#include <boost/assign/v2/detail/checking/array.hpp>
+#include <boost/assign/v2/detail/checking/map.hpp>
#include <boost/assign/v2/detail/checking/range.hpp>
namespace boost{
@@ -29,6 +30,14 @@
checking::do_check( tag(), v );
}
+ template<typename V>
+ void do_check(V & v) // This is needed for operator[]
+ {
+ using namespace checking::constants;
+ typedef typename checking::deduce_check<V>::type tag;
+ checking::do_check( tag(), v );
+ }
+
}// container
}// checking
}// v2
Modified: sandbox/statistics/support/boost/assign/v2/detail/checking/deduce_check.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/checking/deduce_check.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/checking/deduce_check.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -11,6 +11,7 @@
#define BOOST_ASSIGN_V2_CHECKING_DEDUCE_TAG_ER_2010_HPP
#include <boost/assign/v2/detail/type_traits/container/is_fifo.hpp>
#include <boost/assign/v2/detail/type_traits/container/is_lifo.hpp>
+#include <boost/assign/v2/detail/type_traits/container/is_map.hpp>
#include <boost/assign/v2/detail/type_traits/container/is_sorted.hpp>
#include <boost/assign/v2/detail/type_traits/container/is_static_array.hpp>
#include <boost/assign/v2/detail/type_traits/container/is_range.hpp>
@@ -41,19 +42,27 @@
template<>
struct case_<switch_tag::deduce_check,2> :
v2::mpl::wrap<
+ v2::container_tag::map,
+ v2::container_type_traits::is_map
+ >{};
+
+ template<>
+ struct case_<switch_tag::deduce_check,3> :
+ v2::mpl::wrap<
v2::container_tag::sorted,
v2::container_type_traits::is_sorted
>{};
template<>
- struct case_<switch_tag::deduce_check,3> :
+ struct case_<switch_tag::deduce_check,4> :
v2::mpl::wrap<
v2::container_tag::static_array,
v2::container_type_traits::is_static_array
>{};
+
template<>
- struct case_<switch_tag::deduce_check,4> :
+ struct case_<switch_tag::deduce_check,5> :
v2::mpl::wrap<
container_tag::range
>{};
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-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -36,6 +36,7 @@
typedef functor_aux::crtp_unary_and_up<this_, meta_result_> super_;
public:
+
constructor(){}
T operator()()const{ return T(); }
Modified: sandbox/statistics/support/boost/assign/v2/detail/functor/functor.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/functor/functor.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/functor/functor.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -13,5 +13,6 @@
#include <boost/assign/v2/detail/functor/crtp_unary_and_up.hpp>
#include <boost/assign/v2/detail/functor/constructor.hpp>
#include <boost/assign/v2/detail/functor/identity.hpp>
+#include <boost/assign/v2/detail/functor/new.hpp>
#endif
\ No newline at end of file
Modified: sandbox/statistics/support/boost/assign/v2/detail/fwd/container.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/fwd/container.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/fwd/container.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -37,9 +37,12 @@
}// std
namespace boost{
- // http://www.boost.org/doc/libs/1_43_0/doc/html/array.html
+ // http://www.boost.org/doc/libs/release/doc/html/array.html
template<typename T, std::size_t size> class array;
+ // http://www.boost.org/doc/libs/release/libs/circular_buffer/index.html
+ template<typename T, typename Alloc> class circular_buffer;
+
}// boost
-#endif
\ No newline at end of file
+#endif
Modified: sandbox/statistics/support/boost/assign/v2/detail/fwd/fwd.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/fwd/fwd.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/fwd/fwd.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -11,5 +11,6 @@
#define BOOST_ASSIGN_V2_DETAIL_FWD_FWD_ER_2010_HPP
#include <boost/assign/v2/detail/fwd/container.hpp>
+#include <boost/assign/v2/detail/fwd/ptr_container.hpp>
#endif
Modified: sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/container.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/container.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/container.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -12,12 +12,20 @@
#include <boost/assign/v2/detail/type_traits/container/has_push.hpp>
#include <boost/assign/v2/detail/type_traits/container/has_static_size.hpp>
+#include <boost/assign/v2/detail/type_traits/container/forward_to_value.hpp>
+#include <boost/assign/v2/detail/type_traits/container/is_associative.hpp>
#include <boost/assign/v2/detail/type_traits/container/is_fifo.hpp>
#include <boost/assign/v2/detail/type_traits/container/is_lifo.hpp>
#include <boost/assign/v2/detail/type_traits/container/is_map.hpp>
+#include <boost/assign/v2/detail/type_traits/container/is_ptr_container.hpp>
#include <boost/assign/v2/detail/type_traits/container/is_range.hpp>
+#include <boost/assign/v2/detail/type_traits/container/is_set.hpp>
#include <boost/assign/v2/detail/type_traits/container/is_sorted.hpp>
#include <boost/assign/v2/detail/type_traits/container/is_static_array.hpp>
+#include <boost/assign/v2/detail/type_traits/container/ptr_to_value.hpp>
+#include <boost/assign/v2/detail/type_traits/container/ptr_to_value_container.hpp>
+#include <boost/assign/v2/detail/type_traits/container/static_size.hpp>
#include <boost/assign/v2/detail/type_traits/container/value.hpp>
+#include <boost/assign/v2/detail/type_traits/container/value_container.hpp>
-#endif
\ No newline at end of file
+#endif
Modified: sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/has_static_size.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/has_static_size.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/has_static_size.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -9,6 +9,7 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_TYPE_TRAITS_CONTAINER_HAS_STATIC_SIZE_ER_2010_HPP
#define BOOST_ASSIGN_V2_TYPE_TRAITS_CONTAINER_HAS_STATIC_SIZE_ER_2010_HPP
+#include <boost/assign/v2/detail/fwd/ptr_container.hpp>
#include <boost/mpl/bool.hpp>
namespace boost{
@@ -35,6 +36,9 @@
typedef boost::mpl::bool_<value> type;
};
+ template<typename T,std::size_t N,typename C>
+ struct has_static_size< boost::ptr_array<T, N, C> > : boost::mpl::true_{};
+
}// container_type_traits
}// v2
}// assign
Modified: sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_fifo.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_fifo.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_fifo.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -10,7 +10,10 @@
#ifndef BOOST_ASSIGN_V2_TYPE_TRAITS_CONTAINER_IS_FIFO_ER_2010_HPP
#define BOOST_ASSIGN_V2_TYPE_TRAITS_CONTAINER_IS_FIFO_ER_2010_HPP
#include <boost/mpl/bool.hpp>
+#include <boost/type_traits/remove_cv.hpp>
#include <boost/assign/v2/detail/fwd/container.hpp>
+#include <boost/assign/v2/detail/type_traits/container/is_ptr_container.hpp>
+#include <boost/assign/v2/detail/type_traits/container/forward_to_value.hpp>
namespace boost{
namespace assign{
@@ -21,10 +24,17 @@
namespace container_type_traits{
template<typename V>
- struct is_fifo : boost::mpl::false_{};
+ struct is_fifo_impl : boost::mpl::false_{};
template<typename T,typename A>
- struct is_fifo< std::queue<T,A> > : boost::mpl::true_{};
+ struct is_fifo_impl< std::queue<T,A> > : boost::mpl::true_{};
+
+ template<typename V>
+ struct is_fifo : forward_to_value<
+ is_fifo_impl,
+ typename boost::remove_cv<V>::type
+ >{};
+
}// container_type_traits
}// v2
Modified: sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_lifo.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_lifo.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_lifo.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -10,7 +10,10 @@
#ifndef BOOST_ASSIGN_V2_TYPE_TRAITS_CONTAINER_IS_LIFO_ER_2010_HPP
#define BOOST_ASSIGN_V2_TYPE_TRAITS_CONTAINER_IS_LIFO_ER_2010_HPP
#include <boost/mpl/bool.hpp>
+#include <boost/type_traits/remove_cv.hpp>
#include <boost/assign/v2/detail/fwd/container.hpp>
+#include <boost/assign/v2/detail/type_traits/container/is_ptr_container.hpp>
+#include <boost/assign/v2/detail/type_traits/container/forward_to_value.hpp>
namespace boost{
namespace assign{
@@ -21,10 +24,16 @@
namespace container_type_traits{
template<typename V>
- struct is_lifo : boost::mpl::false_{};
+ struct is_lifo_impl : boost::mpl::false_{};
template<typename T,typename A>
- struct is_lifo< std::stack<T,A> > : boost::mpl::true_{};
+ struct is_lifo_impl< std::stack<T,A> > : boost::mpl::true_{};
+
+ template<typename V>
+ struct is_lifo : forward_to_value<
+ is_lifo_impl,
+ typename boost::remove_cv<V>::type
+ >{};
}// container_type_traits
}// v2
Modified: sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_map.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_map.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_map.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -12,24 +12,30 @@
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/assign/v2/detail/fwd/container.hpp>
+#include <boost/assign/v2/detail/type_traits/container/is_ptr_container.hpp>
+#include <boost/assign/v2/detail/type_traits/container/forward_to_value.hpp>
namespace boost{
namespace assign{
namespace v2{
+namespace container_tag{
+ struct map{};
+}// container_tag
namespace container_type_traits{
template<typename V>
- struct is_map_impl: boost::mpl::false_{};
+ struct is_map_impl : boost::mpl::false_{};
template<typename K,typename D,typename C,typename A>
- struct is_map_impl< std::map<K,D,C,A> > : boost::mpl::true_{};
-
+ struct is_map_impl<
+ std::map<K,D,C,A>
+ > : boost::mpl::true_{};
template<typename V>
- struct is_map : is_map_impl<
+ struct is_map : forward_to_value<
+ is_map_impl,
typename boost::remove_cv<V>::type
>{};
-
}// container_type_traits
}// v2
Modified: sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_sorted.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_sorted.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_sorted.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -10,7 +10,9 @@
#ifndef BOOST_ASSIGN_V2_TYPE_TRAITS_CONTAINER_IS_SORTED_ER_2010_HPP
#define BOOST_ASSIGN_V2_TYPE_TRAITS_CONTAINER_IS_SORTED_ER_2010_HPP
#include <boost/mpl/bool.hpp>
+#include <boost/type_traits/remove_cv.hpp>
#include <boost/assign/v2/detail/fwd/container.hpp>
+#include <boost/assign/v2/detail/type_traits/container/forward_to_value.hpp>
namespace boost{
namespace assign{
@@ -21,13 +23,19 @@
namespace container_type_traits{
template<typename V>
- struct is_sorted : boost::mpl::false_{};
+ struct is_sorted_impl : boost::mpl::false_{};
template<typename T,typename C,typename A>
- struct is_sorted< std::set<T,C,A> > : boost::mpl::true_{};
+ struct is_sorted_impl< std::set<T,C,A> > : boost::mpl::true_{};
template<typename K,typename T,typename C,typename A>
- struct is_sorted< std::map<K,T,C,A> > : boost::mpl::true_{};
+ struct is_sorted_impl< std::map<K,T,C,A> > : boost::mpl::true_{};
+
+ template<typename V>
+ struct is_sorted : forward_to_value<
+ is_sorted_impl,
+ typename boost::remove_cv<V>::type
+ >{};
}// container_type_traits
}// v2
Modified: sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_static_array.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_static_array.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/is_static_array.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -9,7 +9,9 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_TYPE_TRAITS_CONTAINER_IS_STATIC_ARRAY_ER_2010_HPP
#define BOOST_ASSIGN_V2_TYPE_TRAITS_CONTAINER_IS_STATIC_ARRAY_ER_2010_HPP
+#include <boost/type_traits/remove_cv.hpp>
#include <boost/assign/v2/detail/type_traits/container/has_static_size.hpp>
+#include <boost/assign/v2/detail/type_traits/container/forward_to_value.hpp>
namespace boost{
@@ -29,8 +31,13 @@
// TODO also check that operator[] exists
template<typename T>
- struct is_static_array : has_static_size<T>{};
+ struct is_static_array_impl : has_static_size<T>{};
+ template<typename V>
+ struct is_static_array : forward_to_value<
+ is_static_array_impl,
+ typename boost::remove_cv<V>::type
+ >{};
}// container_type_traits
}// v2
Modified: sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/value.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/value.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/detail/type_traits/container/value.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -9,7 +9,11 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_TYPE_TRAITS_CONTAINER_VALUE_ER_2010_HPP
#define BOOST_ASSIGN_V2_TYPE_TRAITS_CONTAINER_VALUE_ER_2010_HPP
+#include <boost/mpl/eval_if.hpp>
+#include <boost/mpl/identity.hpp>
+#include <boost/type_traits/remove_pointer.hpp>
#include <boost/assign/v2/detail/type_traits/value.hpp>
+#include <boost/assign/v2/detail/type_traits/container/forward_to_value.hpp>
namespace boost{
namespace assign{
@@ -18,12 +22,16 @@
{
// TODO
- // if range_reference<V>::type exists,
- // remove_reference<typename range_reference<V>::type>::type
- // else
- // type_traits::value<V>::type
+ // maybe this should be
+ // remove_reference<V::reference>::type
+ // or
+ // range_value<V>, is available.
+ // Think about ptr_container in making this change.
template<typename V>
- struct value : type_traits::value<V>{};
+ struct value : forward_to_value<
+ type_traits::value,
+ V
+ >{};
}// container_type_traits
}// v2
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-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -27,6 +27,10 @@
void impl(V& v,T& t)const{
v.at( i++ ) = t;
}
+
+ // TODO
+ 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/deduce.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/put/modifier/deduce.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/put/modifier/deduce.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -13,8 +13,8 @@
#include <boost/assign/v2/detail/type_traits/container/is_static_array.hpp>
#include <boost/assign/v2/detail/type_traits/container/has_push.hpp>
-#include <boost/assign/v2/detail/type_traits/container/is_map.hpp>
-
+#include <boost/assign/v2/detail/type_traits/container/is_associative.hpp>
+
namespace boost{
namespace assign{
namespace v2{
@@ -33,7 +33,7 @@
struct case_<switch_tag::deduce_put,0> :
v2::mpl::wrap<
v2::put_tag::insert,
- v2::container_type_traits::is_map
+ v2::container_type_traits::is_associative
>{};
template<>
Modified: sandbox/statistics/support/boost/assign/v2/put/modifier/push_back.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/put/modifier/push_back.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/put/modifier/push_back.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -9,6 +9,7 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_PUT_MODIFIER_PUSH_BACK_ER_2010_HPP
#define BOOST_ASSIGN_V2_PUT_MODIFIER_PUSH_BACK_ER_2010_HPP
+#include <boost/utility/enable_if.hpp>
#include <boost/assign/v2/put/modifier/def.hpp>
namespace boost{
@@ -21,9 +22,12 @@
struct modifier<v2::put_tag::push_back>{
modifier(){}
-
+
+ template<typename V,typename T>
+ void impl(V& v,T& t)const{ v.push_back( t ); }
+
template<typename V,typename T>
- void impl(V& v,T& t)const{ v.push_back( t ); }
+ void impl(V& v,T* t)const{ v.push_back( t ); }
};
Modified: sandbox/statistics/support/boost/assign/v2/put/wrapper/crtp.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/put/wrapper/crtp.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/put/wrapper/crtp.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -15,9 +15,11 @@
#include <boost/preprocessor/repeat_from_to.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
#include <boost/mpl/always.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/arity_bound.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/put/modifier/modifier.hpp>
@@ -26,32 +28,11 @@
// Usage //
// --------------- //
// Calling
-// object = put( v );
-// wraps a class object around v, whose overloaded operator() and csv() mf act
-// as a modifiers of v. To recover v, call
-// object.unwrap();
-//
-// Let cond1 = ( k < BOOST_ASSIGN_V2_LVALUE_CONST_ARITY_BOUND )
-// Let cond2 = all arguments are lvalues.
-//
-// -- Overloaded syntax --
-//
-// For 0 <= k(i) < BOOST_ASSIGN_V2_ARITY_BOUND
-// Expression
-// object( x11, ..., x1k(1) ) ... ( xn1, ..., xnk(n) )
-// Side effect
-// for each i=1,...,n puts f( xi1, ..., xik(i) ) into v for each i=1,...,n.
-// Returns a reference to the wrapper.
-//
-// Each argument's lvalue is preserved if either cond1 OR (!cond1 AND cond2)
-// In all other cases, arguments are passed as const references.
+// put( v )( a )()( c0, c11 );
//
// ----- csv syntax ------
//
-// For k(i) = 1, and n < BOOST_ASSIGN_V2_CSV_ARITY_BOUND,
-// object.csv( x11, ..., xn1 )
-// Same return and effect as above by redefining cond1 = false.
-
+// put( v )( a )( T() )( T(c0, c11) );
namespace boost{
namespace assign{
@@ -62,18 +43,28 @@
template<typename V>
struct crtp_traits
{
+// typedef typename v2::container_type_traits::value<V>::type value_type;
+// typedef typename result_of::constructor<value_type>::type functor_type;
+// typedef typename put_aux::deduce_modifier<V>::type put_tag;
+
+ // Experimental
typedef typename v2::container_type_traits::value<V>::type value_type;
- typedef typename result_of::constructor<value_type>::type functor_type;
+ typedef typename boost::mpl::eval_if<
+ container_type_traits::is_ptr_container<V>,
+ functor_aux::deduce_new_<V>,
+ functor_aux::deduce_constructor<V>
+ >::type functor_type;
typedef typename put_aux::deduce_modifier<V>::type put_tag;
+
};
// Requirements:
// d.unwrap() returns a reference to V&
// D d(U v, F const& f); Constructs an object, d, of type D.
// Usually f is passed to the crtp. U = V& or V const& depending on need.
- template<typename V,typename F, typename Tag,typename D,typename Traits>
+ template<typename V,typename F, typename Tag, typename D, typename Traits>
class crtp : public functor_aux::crtp_unary_and_up<
- crtp<V,F,Tag,D,Traits>,
+ crtp<V, F, Tag, D, Traits>,
boost::mpl::always< D const& >
>
{
@@ -102,7 +93,6 @@
result_type operator()()const
{
return this->arg_deduct( this->f() );
- return this->derived();
}
#define BOOST_ASSIGN_V2_impl(z, N, data) \
@@ -235,6 +225,14 @@
protected:
+ // Experimental
+ template<typename T>
+ result_type arg_deduct(T* t)const
+ {
+ this->modifier.impl( this->derived().unwrap(), t );
+ return this->derived();
+ }
+
template<typename T>
result_type arg_deduct(T& t)const
{
Modified: sandbox/statistics/support/boost/assign/v2/put/wrapper/make.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/put/wrapper/make.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/put/wrapper/make.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -12,11 +12,11 @@
#include <boost/assign/v2/ref/wrapper/copy.hpp>
#include <boost/assign/v2/put/wrapper/crtp.hpp>
-// Modifiers:
-// object % ( _put_tag = Tag() ); Component 1-
-// object % ( _fun = F() ); Component 2-
-// object % ( _incr_lookup ); ++v[ f( xi1, ..., xik(i) ) ];
-// object % ( _repeat = n );
+// Usage:
+// put( v ) % ( _put_tag = Tag() );
+// put( v ) % ( _fun = F() );
+// put( v ) % ( _incr_lookup );
+// put( v ) % ( _repeat = n );
namespace boost{
namespace assign{
Modified: sandbox/statistics/support/boost/assign/v2/v2.hpp
==============================================================================
--- sandbox/statistics/support/boost/assign/v2/v2.hpp (original)
+++ sandbox/statistics/support/boost/assign/v2/v2.hpp 2010-08-09 17:15:03 EDT (Mon, 09 Aug 2010)
@@ -14,7 +14,6 @@
#include <boost/assign/v2/chain/chain.hpp>
#include <boost/assign/v2/detail/detail.hpp>
#include <boost/assign/v2/put/put.hpp>
-#include <boost/assign/v2/put/range/range.hpp>
#include <boost/assign/v2/ref/ref.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