Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69558 - in sandbox/assign_v2/boost/assign/v2/put: deque frame modulo modulo/ext modulo/std
From: erwann.rogard_at_[hidden]
Date: 2011-03-04 15:58:42


Author: e_r
Date: 2011-03-04 15:58:39 EST (Fri, 04 Mar 2011)
New Revision: 69558
URL: http://svn.boost.org/trac/boost/changeset/69558

Log:
upd assign_v2
Added:
   sandbox/assign_v2/boost/assign/v2/put/deque/modulo.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/frame/fwd.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modulo/ext/
   sandbox/assign_v2/boost/assign/v2/put/modulo/ext/frame.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modulo/ext/xxx.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modulo/std/
   sandbox/assign_v2/boost/assign/v2/put/modulo/std.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modulo/std/frame.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modulo/std/xxx.hpp (contents, props changed)

Added: sandbox/assign_v2/boost/assign/v2/put/deque/modulo.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/deque/modulo.hpp 2011-03-04 15:58:39 EST (Fri, 04 Mar 2011)
@@ -0,0 +1,40 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_DEQUE_MODULO_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_DEQUE_MODULO_ER_2010_HPP
+#include <boost/assign/v2/put/modulo/fun.hpp>
+#include <boost/assign/v2/put/modulo/modifier.hpp>
+#include <boost/assign/v2/put/deque/fwd.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace result_of_modulo{
+
+ template<typename T,typename F,typename Tag>
+ struct fun<put_deque_aux::cont<T, F, Tag> >
+ {
+ template<typename F1>
+ struct apply{ typedef put_deque_aux::cont<T, F1, Tag> type; };
+ };
+
+ template<typename T,typename F, typename Tag>
+ struct modifier<put_deque_aux::cont<T, F, Tag> >
+ {
+ template<typename Tag1>
+ struct apply{ typedef put_deque_aux::cont<T, F, Tag1> type; };
+ };
+
+}// result_of_modulo
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/frame/fwd.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/frame/fwd.hpp 2011-03-04 15:58:39 EST (Fri, 04 Mar 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_FWD_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_FRAME_FWD_ER_2010_HPP
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+
+
+ template<typename C, typename F, typename Tag, typename D> class crtp;
+
+}// put_aux
+}// v2
+}// assign
+}// boost
+
+#endif
+

Added: sandbox/assign_v2/boost/assign/v2/put/modulo/ext/frame.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modulo/ext/frame.hpp 2011-03-04 15:58:39 EST (Fri, 04 Mar 2011)
@@ -0,0 +1,114 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODULO_EXT_FRAME_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_MODULO_EXT_FRAME_ER_2010_HPP
+#include <boost/concept_check.hpp>
+#include <boost/concept/assert.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/eval_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+
+#include <boost/assign/v2/put/frame/modifier.hpp>
+#include <boost/assign/v2/put/modulo/modifier.hpp>
+#include <boost/assign/v2/put/modulo/fun_modifier.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_parameter{
+
+ template<typename F, typename Tag>
+ struct traits{
+ typedef F fun_type;
+ typedef Tag modifier_tag;
+ typedef traits<F, Tag> type;
+ };
+
+}// put_parameter
+namespace put_concept{
+
+ template<typename Tag, typename P>
+ struct ExtParam
+ {
+ BOOST_CONCEPT_USAGE(ExtParam)
+ {
+ typedef put_aux::modifier<Tag> m_;
+ m_ m( p.arg() );
+ }
+
+ private:
+ static P & p;
+ };
+
+}// put_concept
+namespace result_of_modulo{
+
+ template<typename D>
+ struct ext{
+
+ template<typename FParameter>
+ struct apply{
+
+ typedef typename D::fun_type old_fun_;
+ typedef typename D::modifier_tag old_tag;
+ typedef typename ::boost::mpl::apply2<
+ FParameter, old_fun_, old_tag
+ >::type traits_;
+ typedef typename traits_::fun_type fun_;
+ typedef typename traits_::modifier_tag tag;
+
+ typedef result_of_modulo::modifier<D> meta1_;
+ typedef result_of_modulo::fun_modifier<D> meta2_;
+
+ typedef boost::is_same<fun_, old_fun_> is_same_fun_;
+ typedef typename ::boost::mpl::eval_if<
+ is_same_fun_,
+ ::boost::mpl::apply1< meta1_, tag >,
+ ::boost::mpl::apply2< meta2_, fun_, tag>
+ >::type type;
+
+ typedef put_aux::modifier<tag> m_;
+
+ template<typename C, typename F>
+ static type call(C& cont, F const& f, m_ const& m)
+ {
+ return type( cont, f, m );
+ }
+ static fun_ make_fun(const D& derived, ::boost::mpl::false_)
+ {
+ return fun_();
+ }
+ static fun_ make_fun(const D& derived, ::boost::mpl::true_)
+ {
+ return derived.fun;
+ }
+ template<typename P>
+ static type call(const D& derived, P const& p)
+ {
+ typedef put_concept::ExtParam<tag, P> concept_;
+ BOOST_CONCEPT_ASSERT(( concept_ ));
+ return call(
+ derived.container(),
+ make_fun( derived, is_same_fun_() ),
+ m_( p.arg() )
+ );
+ }
+
+ };
+
+ };
+
+}// result_of_modulo
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/modulo/ext/xxx.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modulo/ext/xxx.hpp 2011-03-04 15:58:39 EST (Fri, 04 Mar 2011)
@@ -0,0 +1,55 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODULO_EXT_XXX
+#include <boost/preprocessor/cat.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/quote.hpp>
+#include <boost/utility/enable_if.hpp>
+
+// Needed by dependants
+#include <boost/assign/v2/detail/keyword/nil.hpp>
+#include <boost/assign/v2/put/modulo/modifier.hpp>
+
+#include <boost/assign/v2/detail/pp/forward.hpp>
+#include <boost/assign/v2/put/frame/crtp.hpp>
+#include <boost/assign/v2/put/frame/modifier.hpp>
+#include <boost/assign/v2/put/modulo/ext.hpp>
+
+#define BOOST_ASSIGN_V2_PUT_MODULO_EXT_XXX(Param)\
+namespace result_of_modulo{\
+ template<typename D, typename Arg>\
+ struct Param\
+ : ::boost::mpl::apply1<\
+ result_of_modulo::ext<D>\
+ , put_parameter::Param<Arg>\
+ >\
+ {};\
+}\
+namespace put_aux{\
+\
+ template<typename C, typename F, typename Tag, typename D, typename Arg>\
+ typename result_of_modulo::Param<D, Arg>::type\
+ operator%(\
+ crtp<C, F, Tag, D> const& lhs,\
+ put_aux::Param<Arg> const& rhs\
+ )\
+ {\
+ typedef result_of_modulo::Param<D, Arg> caller_;\
+ return caller_::call( lhs.derived(), rhs );\
+ }\
+\
+}\
+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/modulo/std.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modulo/std.hpp 2011-03-04 15:58:39 EST (Fri, 04 Mar 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_MODULO_STD_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_MODULO_STD_ER_2010_HPP
+
+#include <boost/assign/v2/put/modulo/std/frame.hpp>
+#include <boost/assign/v2/put/modulo/std/xxx.hpp>
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/modulo/std/frame.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modulo/std/frame.hpp 2011-03-04 15:58:39 EST (Fri, 04 Mar 2011)
@@ -0,0 +1,67 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODULO_STD_FRAME_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_MODULO_STD_FRAME_ER_2010_HPP
+#include <boost/mpl/apply.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/assign/v2/put/frame/fwd.hpp>
+#include <boost/assign/v2/put/frame/modifier.hpp>
+#include <boost/assign/v2/put/modulo/modifier.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+
+ template<typename Tag>
+ struct modulo_std
+ {
+ modulo_std(){}
+ modulo_std(Tag const& t) : modifier_tag( t ){}
+ Tag modifier_tag;
+ };
+
+ template<typename C, typename F, typename Tag, typename D, typename Tag1>
+ typename ::boost::mpl::apply1<result_of_modulo::modifier<D>, Tag1>::type
+ operator%(
+ crtp<C, F, Tag, D> const& lhs,
+ modulo_std<Tag1> const& rhs
+ )
+ {
+ typedef result_of_modulo::modifier<D> meta_;
+
+ typedef typename ::boost::mpl::apply1<meta_, Tag1>::type result_;
+ typedef put_aux::modifier<Tag1> modifier_;
+ return result_(
+ lhs.container(),
+ lhs.fun,
+ modifier_( rhs.modifier_tag )
+ );
+ }
+
+ struct kwd_std
+ {
+ template<typename Tag>
+ modulo_std<Tag> operator=( Tag const& t)const
+ {
+ return modulo_std<Tag>( t );
+ }
+ };
+
+}// put_aux
+namespace{
+ put_aux::kwd_std const _std = put_aux::kwd_std();
+}
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/modulo/std/xxx.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modulo/std/xxx.hpp 2011-03-04 15:58:39 EST (Fri, 04 Mar 2011)
@@ -0,0 +1,86 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODULO_STD_XXX
+#include <boost/preprocessor/cat.hpp>
+#include <boost/accumulators/framework/accumulator_base.hpp>
+#include <boost/assign/v2/put/frame/modifier.hpp>
+#include <boost/assign/v2/put/modulo/std.hpp>
+
+#define BOOST_ASSIGN_V2_PUT_STD_IMPL_PTR(FUN)\
+ template<typename C, typename T>\
+ void impl(C& cont, T* t)const{\
+ cont.FUN( t );\
+ }\
+/**/
+#define BOOST_ASSIGN_V2_PUT_STD_IMPL_LVALUE(FUN)\
+ template<typename C, typename T>\
+ void impl(C& cont, T& t)const{\
+ cont.FUN( t );\
+ }\
+/**/
+
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/is_reference.hpp>
+// disable_if necessary to avoid ambiguity resolution with GCC4.4
+#define BOOST_ASSIGN_V2_PUT_STD_IMPL_RVALUE(FUN)\
+ template<typename C, typename T>\
+ typename boost::disable_if<\
+ boost::is_reference<T>,\
+ void\
+ >::type\
+ impl(C& cont, T&& t)const{\
+ cont.FUN( std::move( t ) );\
+ }\
+/**/
+#define BOOST_ASSIGN_V2_PUT_STD_IMPL(FUN)\
+ BOOST_ASSIGN_V2_PUT_STD_IMPL_LVALUE(FUN)\
+ BOOST_ASSIGN_V2_PUT_STD_IMPL_RVALUE(FUN)\
+/**/
+#else
+#define BOOST_ASSIGN_V2_PUT_STD_IMPL(FUN)\
+ BOOST_ASSIGN_V2_PUT_STD_IMPL_LVALUE(FUN)\
+/**/
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+#define BOOST_ASSIGN_V2_PUT_MODULO_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_ ){}\
+ BOOST_ASSIGN_V2_PUT_STD_IMPL(FUN)\
+ };\
+\
+}\
+namespace{\
+\
+ put_aux::modulo_std<v2::modifier_tag::FUN> const\
+ BOOST_PP_CAT(_,FUN) = ( \
+ _std = 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