|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r69925 - in sandbox/assign_v2/boost/assign/v2/put/modifier: . modulo
From: erwann.rogard_at_[hidden]
Date: 2011-03-13 09:43:35
Author: e_r
Date: 2011-03-13 09:43:28 EDT (Sun, 13 Mar 2011)
New Revision: 69925
URL: http://svn.boost.org/trac/boost/changeset/69925
Log:
upd assign_v2
Removed:
sandbox/assign_v2/boost/assign/v2/put/modifier/modulo/
Text files modified:
sandbox/assign_v2/boost/assign/v2/put/modifier/iterate.hpp | 2
sandbox/assign_v2/boost/assign/v2/put/modifier/lookup.hpp | 2
sandbox/assign_v2/boost/assign/v2/put/modifier/modulo.hpp | 176 +++++++++++++++++++++++++++++++++++++++
sandbox/assign_v2/boost/assign/v2/put/modifier/repeat.hpp | 2
4 files changed, 177 insertions(+), 5 deletions(-)
Modified: sandbox/assign_v2/boost/assign/v2/put/modifier/iterate.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/modifier/iterate.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/iterate.hpp 2011-03-13 09:43:28 EDT (Sun, 13 Mar 2011)
@@ -11,7 +11,7 @@
#define BOOST_ASSIGN_V2_PUT_MODIFIER_ITERATE_ER_2010_HPP
#include <boost/assign/v2/put/modifier/iterate/impl.hpp>
#include <boost/assign/v2/put/modifier/iterate/tag.hpp>
-#include <boost/assign/v2/put/modifier/modulo/modifier.hpp>
+#include <boost/assign/v2/put/modifier/modulo.hpp>
BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_KEYWORD(iterate)
#define BOOST_ASSIGN_V2_TAG modifier_tag::iterate<Arg>
Modified: sandbox/assign_v2/boost/assign/v2/put/modifier/lookup.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/modifier/lookup.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/lookup.hpp 2011-03-13 09:43:28 EDT (Sun, 13 Mar 2011)
@@ -11,7 +11,7 @@
#define BOOST_ASSIGN_V2_PUT_MODIFIER_LOOKUP_ER_2010_HPP
#include <boost/assign/v2/put/modifier/lookup/impl.hpp>
#include <boost/assign/v2/put/modifier/lookup/tag.hpp>
-#include <boost/assign/v2/put/modifier/modulo/modifier.hpp>
+#include <boost/assign/v2/put/modifier/modulo.hpp>
BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_KEYWORD(lookup)
#define BOOST_ASSIGN_V2_TAG modifier_tag::lookup<Arg>
Modified: sandbox/assign_v2/boost/assign/v2/put/modifier/modulo.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/modifier/modulo.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/modulo.hpp 2011-03-13 09:43:28 EDT (Sun, 13 Mar 2011)
@@ -9,7 +9,179 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_ER_2010_HPP
#define BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_ER_2010_HPP
-#include <boost/assign/v2/put/modifier/modulo/modifier.hpp>
-#include <boost/assign/v2/put/modifier/standard/modifier.hpp>
+#include <boost/assign/v2/detail/keyword/ignore.hpp>
+#include <boost/assign/v2/detail/pp/ignore.hpp>
+#include <boost/assign/v2/put/adapter/fwd.hpp>
+#include <boost/assign/v2/put/adapter/modifier.hpp>
+#include <boost/assign/v2/put/adapter/replace_parameter.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/preprocessor/cat.hpp>
+namespace boost{
+namespace assign{
+namespace v2{
+//[syntax_put_modifier_modulo
+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 )
+ {}BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
+ Arg const& arg()const/*<-*/
+ {
+ return this->arg_;
+ }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
+ template<typename Arg1>
+ modulo_modifier<Keyword, Arg1>
+ operator=(const Arg1& arg1)const/*<-*/{
+ return modulo_modifier<Keyword, Arg1>( arg1 );
+ }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
+//<-
+ protected:
+ Arg arg_;
+//->
+ };
+
+ 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;
+ };
+
+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
+
+ 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::adapter_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() )
+ );
+ }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
+}// put_aux
+//]
+namespace result_of{
+
+ template<typename D>
+ struct modulo_modifier
+ : put_aux::result_of::modulo_modifier<D>
+ {};
+
+}// result_of
+}// v2
+}// assign
+}// boost
+
+#ifdef BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_META_MODIFIER_TAG
+#error
+#else
+#define BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_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
+
+#ifdef BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_PARAM
+#error
+#else
+#define BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_PARAM(NAME)\
+ put_aux::modulo_modifier<put_aux::BOOST_PP_CAT(keyword_,NAME)>\
+/**/
#endif
+
+#ifdef BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_KEYWORD
+#error
+#else
+#define BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_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_MODIFIER_MODULO_PARAM(NAME) const BOOST_PP_CAT(_,NAME)\
+ = BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_PARAM(NAME)();\
+}\
+}\
+}\
+}\
+/**/
+#endif
+
+// The default
+BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_KEYWORD(standard_modifier)
+BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_META_MODIFIER_TAG(standard_modifier, Arg)
+
+#endif // BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_ER_2010_HPP
Modified: sandbox/assign_v2/boost/assign/v2/put/modifier/repeat.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/modifier/repeat.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/modifier/repeat.hpp 2011-03-13 09:43:28 EDT (Sun, 13 Mar 2011)
@@ -11,7 +11,7 @@
#define BOOST_ASSIGN_V2_PUT_MODIFIER_REPEAT_ER_2010_HPP
#include <boost/assign/v2/put/modifier/repeat/impl.hpp>
#include <boost/assign/v2/put/modifier/repeat/tag.hpp>
-#include <boost/assign/v2/put/modifier/modulo/modifier.hpp>
+#include <boost/assign/v2/put/modifier/modulo.hpp>
BOOST_ASSIGN_V2_PUT_MODIFIER_MODULO_KEYWORD(repeat)
#define BOOST_ASSIGN_V2_TAG modifier_tag::repeat<typename D::modifier_tag>
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