Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69864 - sandbox/assign_v2/boost/assign/v2/put/modifier/framework
From: erwann.rogard_at_[hidden]
Date: 2011-03-11 19:28:04


Author: e_r
Date: 2011-03-11 19:28:00 EST (Fri, 11 Mar 2011)
New Revision: 69864
URL: http://svn.boost.org/trac/boost/changeset/69864

Log:
upd assign_v2
Added:
   sandbox/assign_v2/boost/assign/v2/put/modifier/framework/
   sandbox/assign_v2/boost/assign/v2/put/modifier/framework/keyword.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modifier/framework/make.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modifier/framework/meta.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modifier/framework/standard.hpp (contents, props changed)

Added: sandbox/assign_v2/boost/assign/v2/put/modifier/framework/keyword.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/framework/keyword.hpp 2011-03-11 19:28:00 EST (Fri, 11 Mar 2011)
@@ -0,0 +1,50 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODIFIER_KEYWORD_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_KEYWORD_ER_2010_HPP
+#include <boost/assign/v2/put/modulo/modifier/make.hpp>
+#include <boost/preprocessor/cat.hpp>
+
+#ifndef BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_PARAM
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_PARAM(NAME)\
+ put_aux::modulo_modifier<put_aux::BOOST_PP_CAT(keyword_,NAME)>\
+/**/
+#endif
+
+#ifndef BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_KEYWORD
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_KEYWORD(NAME)\
+namespace boost{\
+namespace assign{\
+namespace v2{\
+namespace put_aux{\
+\
+ struct BOOST_PP_CAT(keyword_,NAME){\
+\
+ BOOST_PP_CAT(keyword_,NAME)(){}\
+\
+ };\
+\
+}\
+namespace {\
+ BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_PARAM(NAME) const BOOST_PP_CAT(_,NAME)\
+ = BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_PARAM(NAME)();\
+}\
+}\
+}\
+}\
+/**/
+#endif
+
+// The default
+BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_KEYWORD(modifier)
+BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_META_MODIFIER_TAG(modifier, Arg)
+
+#endif // BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_KEYWORD_ER_2010_HPP
+

Added: sandbox/assign_v2/boost/assign/v2/put/modifier/framework/make.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/framework/make.hpp 2011-03-11 19:28:00 EST (Fri, 11 Mar 2011)
@@ -0,0 +1,79 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODIFIER_MAKE_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_MAKE_ER_2010_HPP
+#include <boost/preprocessor/cat.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/assign/v2/detail/keyword/ignore.hpp>
+#include <boost/assign/v2/put/frame/fwd.hpp>
+#include <boost/assign/v2/put/frame/modifier.hpp>
+#include <boost/assign/v2/put/modulo/modifier/meta.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+//[modulo_modifier
+namespace put_aux{
+
+ template<typename /*<<A class of modifiers>>*/ Keyword, typename /*<<A part of the modifier's implementation>>*/Arg = keyword_aux::ignore>
+ struct modulo_modifier
+ {
+
+ modulo_modifier(){}
+ modulo_modifier(Arg arg):arg_( arg ){}
+
+ Arg const& arg()const{ return this->arg_; }
+
+ template<typename Arg1>
+ modulo_modifier<Keyword, Arg1>
+ operator=(const Arg1& arg1)const{
+ return modulo_modifier<Keyword, Arg1>( arg1 );
+ }
+
+ protected:
+ Arg arg_;
+ };
+}//put_aux
+//]
+namespace put_aux{
+
+ template<typename C, typename F, typename Tag, typename D,
+ typename Keyword, typename Arg>
+ typename ::boost::mpl::apply2<
+ result_of::modulo_modifier<D>,
+ Keyword, Arg
+ >::type
+ operator%(
+ crtp<C, F, Tag, D> const& lhs,
+ modulo_modifier<Keyword, Arg> const& rhs
+ )
+ {
+ typedef put_aux::meta_modifier_tag<Keyword, Arg> meta_;
+ typedef typename ::boost::mpl::apply1<meta_, D>::type modifier_tag;
+ typedef put_aux::modifier<modifier_tag> modifier_;
+
+ typedef typename ::boost::mpl::apply2<
+ result_of::modulo_modifier<D>,
+ Keyword, Arg
+ >::type result_;
+
+ return result_(
+ lhs.container(),
+ lhs.fun,
+ modifier_( lhs.modifier, rhs.arg() )
+ );
+ }
+
+}// put_aux
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_MAKE_ER_2010_HPP

Added: sandbox/assign_v2/boost/assign/v2/put/modifier/framework/meta.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/framework/meta.hpp 2011-03-11 19:28:00 EST (Fri, 11 Mar 2011)
@@ -0,0 +1,88 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODIFIER_META_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_META_ER_2010_HPP
+#include <boost/assign/v2/put/frame/replace_parameter.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/preprocessor/cat.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+//[meta_modifier_tag
+namespace put_aux{
+
+ template<typename Keyword, typename Arg>
+ struct /*<<Meta-function class to be specialized on Keyword>>*/ meta_modifier_tag
+ {
+ template<typename /*<<Inherits crtp\<\> >>*/ D>
+ struct /*<<Returns a modifier-tag>>*/ apply;
+ };
+
+}// put_aux
+//]
+namespace put_aux{
+namespace result_of{
+
+ template<typename D>
+ struct modulo_modifier{
+
+ typedef put_aux::replace_modifier_tag<D> meta_;
+
+ template<typename Keyword, typename Arg>
+ struct apply : ::boost::mpl::apply1<
+ meta_,
+ typename ::boost::mpl::apply1<
+ put_aux::meta_modifier_tag<Keyword, Arg>,
+ D
+ >::type
+ >{};
+
+ };
+
+}// result_of
+}// put_aux
+//[result_of_modulo_modifier
+namespace result_of{
+
+ template<typename /*<<Inherits crtp\<\> >>*/ D>
+ struct /*<<Meta-function class>>*/ modulo_modifier
+ : put_aux::result_of::modulo_modifier<D>
+ {};
+
+}// result_of
+//]
+}// v2
+}// assign
+}// boost
+
+#ifndef BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_META_MODIFIER_TAG
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_META_MODIFIER_TAG(NAME, Result)\
+namespace boost{\
+namespace assign{\
+namespace v2{\
+namespace put_aux{\
+\
+ template<typename Arg>\
+ struct meta_modifier_tag<BOOST_PP_CAT(keyword_,NAME), Arg>\
+ {\
+ template<typename D>\
+ struct apply{ typedef Result type; };\
+ };\
+\
+}\
+}\
+}\
+}\
+/**/
+#endif
+
+#endif // BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_META_ER_2010_HPP
+

Added: sandbox/assign_v2/boost/assign/v2/put/modifier/framework/standard.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/framework/standard.hpp 2011-03-11 19:28:00 EST (Fri, 11 Mar 2011)
@@ -0,0 +1,97 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODIFIER_STANDARD_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_STANDARD_ER_2010_HPP
+#include <boost/assign/v2/detail/keyword/ignore.hpp>
+#include <boost/assign/v2/put/frame/modifier.hpp>
+#include <boost/assign/v2/put/modulo/modifier/keyword.hpp>
+#include <boost/preprocessor/cat.hpp>
+
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_STANDARD_IMPL_PTR(FUN)\
+ template<typename C, typename T>\
+ void impl(C& cont, T* t)const{\
+ cont.FUN( t );\
+}\
+/**/
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_STANDARD_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_MODULO_MODIFIER_STANDARD_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_MODULO_MODIFIER_STANDARD_IMPL(FUN)\
+BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_STANDARD_IMPL_LVALUE(FUN)\
+BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_STANDARD_IMPL_RVALUE(FUN)\
+/**/
+#else
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_STANDARD_IMPL(FUN)\
+BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_STANDARD_IMPL_LVALUE(FUN)\
+/**/
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_STANDARD_TAG(FUN)\
+namespace boost{\
+namespace assign{\
+namespace v2{\
+namespace modifier_tag{ struct FUN{}; }\
+}\
+}\
+}\
+/**/
+
+// Must be preceded by BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_STANDARD_TAG(FUN)
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_STANDARD(FUN)\
+namespace boost{\
+namespace assign{\
+namespace v2{\
+namespace put_aux{\
+\
+ template<>\
+ class modifier<modifier_tag::FUN>\
+ {\
+ typedef keyword_aux::ignore ignore_;\
+ public:\
+ modifier(){}\
+ modifier( ignore_, ignore_ ){}\
+ BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_STANDARD_IMPL(FUN)\
+ };\
+\
+}\
+namespace{\
+\
+ put_aux::modulo_modifier<put_aux::keyword_modifier, modifier_tag::FUN> const\
+ BOOST_PP_CAT(_,FUN) = ( \
+ _modifier = modifier_tag::FUN() \
+ );\
+\
+}\
+}\
+}\
+}\
+/**/
+
+#endif // BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_STANDARD_ER_2010_HPP


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