Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68509 - in sandbox/assign_v2/boost/assign/v2/put: ext frame std
From: erwann.rogard_at_[hidden]
Date: 2011-01-27 18:48:14


Author: e_r
Date: 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
New Revision: 68509
URL: http://svn.boost.org/trac/boost/changeset/68509

Log:
upd assign_v2
Added:
   sandbox/assign_v2/boost/assign/v2/put/ext/
   sandbox/assign_v2/boost/assign/v2/put/ext/iterate.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/ext/lookup.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/ext/repeat.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/ext/xxx.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/frame/
   sandbox/assign_v2/boost/assign/v2/put/frame/base.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/frame/crtp.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/frame/modifier.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/frame/sub.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/std/
   sandbox/assign_v2/boost/assign/v2/put/std/insert.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/std/push.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/std/push_back.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/std/push_front.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/std/xxx.hpp (contents, props changed)

Added: sandbox/assign_v2/boost/assign/v2/put/ext/iterate.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/ext/iterate.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,112 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_EXT_ITERATE_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_EXT_ITERATE_ER_2010_HPP
+#include <cstddef>
+#include <boost/assign/v2/detail/functor/identity.hpp>
+
+#include <boost/assign/v2/put/ext/xxx.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace modifier_tag{ struct iterate{}; }
+namespace put_parameter{
+
+ template<typename Arg>
+ struct iterate{
+
+ template<typename OldFun, typename OldTag>
+ struct apply : traits<
+ functor_aux::identity,
+ modifier_tag::iterate
+ >{};
+ };
+
+}// put_parameter
+namespace put_aux{
+
+ template<>
+ class modifier<modifier_tag::iterate>
+ {
+
+ public:
+
+ typedef std::size_t size_type;
+
+ modifier() : i( 0 ){}
+ explicit modifier( size_type const& i_ )
+ : i( i_ )
+ {}
+
+ template<typename V, typename T>
+ void impl(V& v, BOOST_ASSIGN_V2_forward_param(T, t) )const
+ {
+ v.at( i++ ) = BOOST_ASSIGN_V2_forward_arg(T, t);
+ }
+
+ template<typename V, typename T>
+ void impl(V& v, T* t)const
+ {
+ v.replace( i++ , t);
+ }
+
+ protected:
+ mutable std::size_t i;
+ };
+
+ template<typename Arg = keyword_aux::nil>
+ class iterate
+ {
+
+ public:
+
+ typedef std::size_t size_type;
+
+ iterate():i( 0 ){}
+ iterate( size_type const& i_)
+ : i( i_ )
+ {}
+
+ size_type const& arg()const{ return this->i; }
+
+ protected:
+ size_type i;
+
+ };
+
+ class iterate_keyword : public iterate<>
+ {
+
+ typedef iterate<> super_t;
+
+ public:
+
+ typedef std::size_t size_type;
+
+ iterate_keyword(){}
+
+ iterate<> operator=( size_type const& n_)const
+ {
+ typedef iterate<> result_;
+ return result_( n_ );
+ }
+
+ };
+
+}// put_aux
+
+BOOST_ASSIGN_V2_PUT_EXT_XXX(iterate)
+
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/ext/lookup.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/ext/lookup.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,94 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_EXT_LOOKUP_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_EXT_LOOKUP_ER_2010_HPP
+#include <boost/call_traits.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/assign/v2/detail/functor/identity.hpp>
+
+#include <boost/assign/v2/put/ext/xxx.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace modifier_tag{ template<typename Arg> struct lookup{}; }
+namespace put_parameter{
+
+ template<typename Arg>
+ struct lookup{
+
+ template<typename OldFun, typename OldTag>
+ struct apply : put_parameter::traits<
+ functor_aux::identity,
+ modifier_tag::lookup<Arg>
+ >{};
+ };
+
+}// put_parameter
+namespace put_aux{
+
+ template<typename Arg>
+ struct modifier<modifier_tag::lookup<Arg> >
+ {
+
+ typedef Arg type;
+ typedef boost::shared_ptr<type> ptr_;
+
+ modifier(){}
+ explicit modifier(
+ typename boost::call_traits<type>::param_type arg
+ ) : ptr( new type( arg ) )
+ {}
+
+ template<typename V,typename T>
+ void impl(V& v, BOOST_ASSIGN_V2_forward_param(T, key) )const{
+ v[ key ] = (*this->ptr)( v[ key ] );
+ }
+
+ private:
+ ptr_ ptr;
+ };
+
+ template<typename Arg>
+ struct lookup
+ {
+ typedef Arg const type;
+
+ explicit lookup(type& k) : key( k ){}
+
+ type& arg()const{ return this->key; }
+
+ private:
+ type& key;
+
+ };
+
+ struct lookup_keyword
+ {
+ lookup_keyword(){}
+
+ template<typename Arg1>
+ lookup<Arg1> operator=(Arg1 const& arg1)const
+ {
+ return lookup<Arg1>( arg1 );
+ }
+
+
+ };
+
+}// put_aux
+
+BOOST_ASSIGN_V2_PUT_EXT_XXX(lookup)
+
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/ext/repeat.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/ext/repeat.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,121 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_EXT_REPEAT_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_EXT_REPEAT_ER_2010_HPP
+#include <boost/assign/v2/put/ext/xxx.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace modifier_tag{ template<typename OldTag> struct repeat{}; }
+namespace put_parameter{
+
+ template<typename Arg>
+ struct repeat{
+
+ template<typename OldFun, typename OldTag>
+ struct apply : put_parameter::traits<
+ OldFun,
+ modifier_tag::repeat<OldTag>
+ >{};
+ };
+
+}// put_parameter
+namespace put_aux{
+
+ template<typename Tag>
+ class modifier<modifier_tag::repeat<Tag> >
+ {
+ typedef modifier<Tag> inner_;
+
+ public:
+
+ typedef std::size_t size_type;
+
+ modifier() : n( 0 ){}
+ explicit modifier( size_type const& n_ )
+ : n( n_ )
+ {
+ }
+
+#define MACRO(arg)\
+ size_type m = this->n;\
+ while(m--) this->inner.impl(\
+ v,\
+ arg\
+ );\
+/**/
+ template<typename V, typename T>
+ void impl(V& v, BOOST_ASSIGN_V2_forward_param(T, t) )const
+ {
+
+ MACRO( BOOST_ASSIGN_V2_forward_arg(T, t) )
+ }
+
+ template<typename V, typename T>
+ void impl(V& v, T* t)const
+ {
+ MACRO( t )
+ }
+
+#undef MACRO
+
+ size_type const& size()const{ return this->n; }
+
+ protected:
+ inner_ inner;
+ size_type n;
+ };
+
+ template<typename Arg = keyword_aux::nil>
+ class repeat
+ {
+
+ public:
+
+ typedef std::size_t size_type;
+
+ repeat( size_type const& n_)
+ : n( n_ )
+ {}
+
+ size_type const& arg()const{ return this->n; }
+
+ protected:
+ size_type n;
+
+ };
+
+ class repeat_keyword
+ {
+
+ public:
+
+ typedef std::size_t size_type;
+
+ repeat_keyword(){}
+
+ repeat<> operator=( size_type const& n_)const
+ {
+ typedef repeat<> result_;
+ return result_( n_ );
+ }
+
+ };
+
+}// put_aux
+
+BOOST_ASSIGN_V2_PUT_EXT_XXX(repeat)
+
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/ext/xxx.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/ext/xxx.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,62 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_EXT_XXX_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_EXT_XXX_ER_2010_HPP
+#include <boost/preprocessor/cat.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/quote.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_base_of.hpp>
+
+/* needed throughout /put/ext : */
+#include <boost/assign/v2/detail/keyword/nil.hpp>
+#include <boost/assign/v2/put/modulo/modifier.hpp>
+#include <boost/assign/v2/put/frame/base.hpp>
+
+#include <boost/assign/v2/detail/pp/forward.hpp>
+#include <boost/assign/v2/put/frame/modifier.hpp>
+#include <boost/assign/v2/put/modulo/ext.hpp>
+
+#define BOOST_ASSIGN_V2_PUT_EXT_XXX(Param)\
+namespace result_of_modulo{\
+\
+ template<typename T, typename Arg>\
+ struct Param\
+ : ::boost::mpl::apply1<\
+ result_of_modulo::ext<T>\
+ , put_parameter::Param<Arg>\
+ >\
+ {};\
+\
+}\
+namespace put_aux{\
+\
+ template<typename T,typename Arg>\
+ typename boost::lazy_enable_if<\
+ boost::is_base_of<put_aux::put_base, T>,\
+ result_of_modulo::Param<T, Arg>\
+ >::type\
+ operator%(\
+ T const& t,\
+ put_aux::Param<Arg> const& p\
+ )\
+ {\
+ typedef result_of_modulo::Param<T, Arg> caller_;\
+ return caller_::call( t, p );\
+ }\
+\
+}\
+namespace{\
+ put_aux::BOOST_PP_CAT(Param,_keyword) const BOOST_PP_CAT(_,Param)\
+ = put_aux::BOOST_PP_CAT(Param,_keyword)();\
+}\
+/**/
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/frame/base.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/frame/base.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,27 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_FRAME_BASE_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_FRAME_BASE_ER_2010_HPP
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+
+ struct put_base{
+ // This base is used in some enable_if
+ };
+
+}// put_aux
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/frame/crtp.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/frame/crtp.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,237 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_FRAME_CRTP_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_FRAME_CRTP_ER_2010_HPP
+#include <boost/mpl/always.hpp>
+#include <boost/mpl/apply.hpp>
+
+#include <boost/assign/v2/detail/functor/constructor.hpp>
+#include <boost/assign/v2/detail/pp/forward.hpp>
+
+#include <boost/assign/v2/put/frame/base.hpp>
+#include <boost/assign/v2/put/frame/modifier.hpp>
+#include <boost/assign/v2/put/modulo/fun.hpp>
+
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#else
+#include <boost/preprocessor/arithmetic.hpp>
+#include <boost/preprocessor/cat.hpp>
+#include <boost/preprocessor/repetition.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{
+namespace v2{
+namespace put_aux{
+
+ template<typename F>
+ struct fun_holder{
+
+ typedef F fun_type;
+
+ fun_holder(){}
+ fun_holder(fun_type const& f) : fun( f ){}
+
+ fun_type fun;
+
+ };
+
+ template<typename Tag>
+ struct modifier_holder{
+
+ typedef Tag modifier_tag;
+ typedef put_aux::modifier<Tag> modifier_type;
+
+ modifier_holder(){}
+ modifier_holder(modifier_type const& m) : modifier( m ){}
+
+ typedef put_aux::modifier<Tag> modifier_;
+
+ modifier_type modifier;
+
+ };
+
+ // D has to model concept_sub::Pre3, with respect to container C, functor F
+ // and Tag. It then models concept_sub::Post
+ template<typename C, typename F, typename Tag, typename D>
+ class crtp :
+ public put_base
+ , public fun_holder<F>
+ , public modifier_holder<Tag>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+//do nothing
+#else
+ , public functor_aux::crtp_unary_and_up<
+ crtp<C, F, Tag, D>,
+ ::boost::mpl::always< D const& >
+ >
+#endif
+ {
+
+ public:
+ typedef D const& result_type;
+
+ protected:
+
+ typedef fun_holder<F> fun_holder_;
+ typedef modifier_holder<Tag> modifier_holder_;
+ typedef typename modifier_holder_::modifier_type modifier_;
+
+ 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 ) : fun_holder_( f ){}
+ explicit crtp( F const& f, modifier_ const& m )
+ : fun_holder_( f ), modifier_holder_( m ){}
+
+ result_type operator()()const
+ {
+ return this->modify( this->fun() );
+ }
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+ //[crtp_functor
+ template<typename...Args>
+ result_type operator()( Args&&...args )const
+ {
+ return this->modify(
+ 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 \
+ { \
+ return this->modify( this->fun(BOOST_PP_ENUM_PARAMS(N,_)) ); \
+ } \
+/**/
+BOOST_PP_REPEAT_FROM_TO(
+ 1,
+ BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_ARITY),
+ MACRO,
+ ~
+)
+#undef MACRO
+#endif
+ C& container()const{ return this->derived().container(); }
+
+ struct result_of_modulo{
+
+ struct deduce
+ {
+ typedef functor_aux::deduce_constructor<C> caller_;
+ typedef typename caller_::type cons_;
+ typedef v2::result_of_modulo::fun<D> meta_;
+ typedef typename ::boost::mpl::apply1<meta_, cons_>::type type;
+ };
+
+ };
+
+ typename result_of_modulo::deduce::type
+ modulo_deduce()const
+ {
+ typedef functor_aux::deduce_constructor<C> caller_;
+ typedef typename caller_::type cons_;
+ typedef typename result_of_modulo::deduce::type result_;
+ return result_(
+ this->derived().container(),
+ caller_::call()
+ );
+ }
+
+ protected:
+
+ template<typename T>
+ result_type modify(T* t)const
+ {
+ typedef put_concept::ModifierImpl<modifier_, C, T*> concept_;
+ BOOST_CONCEPT_ASSERT(( concept_ ));
+ this->modifier.impl( this->derived().container(), t );
+ return this->derived();
+ }
+
+ template<typename T>
+ void check_modifier( BOOST_ASSIGN_V2_forward_param(T, t) )const
+ {
+ typedef put_concept::ModifierImpl<modifier_, C,
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+ T&&
+#else
+ T&
+#endif
+ > concept_;
+ BOOST_CONCEPT_ASSERT(( concept_ ));
+ }
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+ //[crtp_modify
+ template<typename T>
+ result_type modify(T&& t)const
+ {
+ check_modifier( t );
+ this->modifier.impl(
+ this->derived().container(),
+ std::forward<T>( t )
+ );
+ return this->derived();
+ }
+ //]
+#else
+ template<typename T>
+ result_type modify(T& t)const
+ {
+ check_modifier( t );
+ this->modifier.impl( this->derived().container(), t );
+ return this->derived();
+ }
+
+ template<typename T>
+ result_type modify(T const& t)const
+ {
+ check_modifier( t );
+ this->modifier.impl( this->derived().container(), t );
+ return this->derived();
+ }
+
+#endif
+
+ };
+
+}// put_aux
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/frame/modifier.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/frame/modifier.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,54 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_FRAME_MODIFIER_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_FRAME_MODIFIER_ER_2010_HPP
+#include <boost/concept_check.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace modifier_tag{
+ // add as necessary
+}
+namespace put_aux{
+
+ template<typename Tag>
+ struct modifier{
+ /* Specialize on Tag:
+ template<typename V, typename T>
+ void impl(V& v, T& t)const; */
+ };
+
+}// put_aux
+namespace put_concept{
+
+ // M models ModifierImpl with respect to container V and reference
+ // (or pointer) type R
+ template<typename M, typename C, typename R>
+ struct ModifierImpl
+ {
+
+ BOOST_CONCEPT_USAGE(ModifierImpl)
+ {
+ m.impl( cont, t );
+ }
+
+ private:
+ static M& m;
+ static C& cont;
+ static R t;
+ };
+
+}// put_concept
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/frame/sub.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/frame/sub.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,94 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_FRAME_SUB_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_FRAME_SUB_ER_2010_HPP
+#include <boost/concept_check.hpp>
+#include <boost/assign/v2/put/frame/modifier.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_concept{
+namespace sub{
+
+ // X models Pre1 wrt to V
+ template<typename C, typename X>
+ struct Pre1{
+
+ BOOST_CONCEPT_USAGE(Pre1)
+ {
+ X x( v );
+ C& ref = x.container();
+ }
+
+ private:
+ static C& v;
+
+ };
+
+ template<typename C, typename F, typename X>
+ struct Pre2 : Pre1<C, X>{
+
+ BOOST_CONCEPT_USAGE(Pre2)
+ {
+ X x( v, f );
+ }
+
+ private:
+ static C& v;
+ static F const &f;
+
+ };
+
+ template<typename C, typename F, typename Tag,typename X>
+ struct Pre3 : Pre2<C, F, X>{
+
+ typedef put_aux::modifier<Tag> modifier_;
+
+ BOOST_CONCEPT_USAGE(Pre3)
+ {
+ X x( v, f, m );
+ }
+
+ private:
+ static C& v;
+ static F const &f;
+ static modifier_ m;
+
+ };
+
+ template<typename C, typename F, typename Tag, typename X>
+ class Post : Pre3<C, F, Tag, X>
+ {
+
+ typedef Pre3<C, F, Tag, X> super_t;
+ typedef typename super_t::modifier_ modifier_;
+
+ BOOST_CONCEPT_USAGE(Post)
+ {
+ F const& f = x.fun;
+ modifier_ const& m = x.modifier;
+ }
+
+ private:
+ static X const& x;
+ static C& v;
+ static F const &f;
+ static modifier_ m;
+
+ };
+
+}// sub
+}// put_concept
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/std/insert.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/std/insert.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,16 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_STD_INSERT_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_STD_INSERT_ER_2010_HPP
+#include <boost/assign/v2/put/std/xxx.hpp>
+
+BOOST_ASSIGN_V2_PUT_STD_XXX(insert)
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/std/push.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/std/push.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,16 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_STD_PUSH_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_STD_PUSH_ER_2010_HPP
+#include <boost/assign/v2/put/std/xxx.hpp>
+
+BOOST_ASSIGN_V2_PUT_STD_XXX(push)
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/std/push_back.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/std/push_back.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,16 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_STD_PUSH_BACK_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_STD_PUSH_BACK_ER_2010_HPP
+#include <boost/assign/v2/put/std/xxx.hpp>
+
+BOOST_ASSIGN_V2_PUT_STD_XXX(push_back)
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/std/push_front.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/std/push_front.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,16 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_STD_PUSH_FRONT_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_STD_PUSH_FRONT_ER_2010_HPP
+#include <boost/assign/v2/put/std/xxx.hpp>
+
+BOOST_ASSIGN_V2_PUT_STD_XXX(push_front)
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/std/xxx.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/std/xxx.hpp 2011-01-27 18:48:13 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,61 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_PUT_STD_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/frame/modifier.hpp>
+#include <boost/assign/v2/put/modulo/modifier.hpp>
+
+#define BOOST_ASSIGN_V2_PUT_STD_XXX(FUN)\
+namespace boost{\
+namespace assign{\
+namespace v2{\
+namespace modifier_tag{ struct FUN{}; }\
+namespace put_aux{\
+\
+ template<>\
+ class modifier<v2::modifier_tag::FUN>\
+ {\
+\
+ typedef boost::accumulators::dont_care dont_care_;\
+\
+ public:\
+\
+ modifier(){}\
+ modifier( dont_care_ ){}\
+\
+ template<typename V, typename 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 ); }\
+\
+ };\
+\
+}\
+namespace{\
+\
+ put_modulo_aux::modifier<v2::modifier_tag::FUN> const\
+ BOOST_PP_CAT(_,FUN) = ( \
+ _modifier = v2::modifier_tag::FUN() \
+ );\
+\
+}\
+}\
+}\
+}\
+/**/
+
+#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