Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68511 - in sandbox/assign_v2/boost/assign/v2/put: . modulo
From: erwann.rogard_at_[hidden]
Date: 2011-01-27 18:51:39


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

Log:
upd assign_v2
Added:
   sandbox/assign_v2/boost/assign/v2/put/container.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modulo/
   sandbox/assign_v2/boost/assign/v2/put/modulo/ext.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modulo/fun.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modulo/fun_modifier.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modulo/generic.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/modulo/modifier.hpp (contents, props changed)

Added: sandbox/assign_v2/boost/assign/v2/put/container.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/container.hpp 2011-01-27 18:51:38 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,17 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_CONTAINER_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_CONTAINER_ER_2010_HPP
+
+#include <boost/assign/v2/put/container/csv.hpp>
+#include <boost/assign/v2/put/container/functor.hpp>
+#include <boost/assign/v2/put/container/range.hpp>
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/modulo/ext.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modulo/ext.hpp 2011-01-27 18:51:38 EST (Thu, 27 Jan 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_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_MODULO_EXT_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{
+
+ // P models Parameter with respect to modifier M
+ template<typename P, typename M>
+ struct ExtParam
+ {
+ BOOST_CONCEPT_USAGE(ExtParam)
+ {
+ M m( p.arg() );
+ }
+
+ private:
+ static P & p;
+ };
+
+}// put_concept
+namespace result_of_modulo{
+
+ template<typename T>
+ struct ext{
+
+ template<typename FParameter>
+ struct apply{
+
+ typedef typename T::fun_type old_fun_;
+ typedef typename T::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<T> meta1_;
+ typedef result_of_modulo::fun_modifier<T> 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& v, F const& f, m_ const& m)
+ {
+ return type( v, f, m );
+ }
+ static fun_ make_fun(const T& t, ::boost::mpl::false_)
+ {
+ return fun_();
+ }
+ static fun_ make_fun(const T& t, ::boost::mpl::true_)
+ {
+ return t.fun;
+ }
+ template<typename P>
+ static type call(const T& t, P const& p)
+ {
+ typedef put_concept::ExtParam<P, m_> concept_;
+ BOOST_CONCEPT_ASSERT(( concept_ ));
+ return call(
+ t.container(),
+ make_fun( t, is_same_fun_() ),
+ m_( p.arg() )
+ );
+ }
+
+ };
+
+ };
+
+}// result_of_modulo
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/modulo/fun.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modulo/fun.hpp 2011-01-27 18:51:38 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,60 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_FUN_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_MODULO_FUN_ER_2010_HPP
+#include <boost/mpl/apply.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace result_of_modulo{
+
+ template<typename D> struct fun/* Specialize on D(erived) */{
+ template<typename F> struct apply{};
+ };
+
+}// result_of_modulo
+namespace put_modulo_aux{
+
+ template<typename F>
+ struct fun
+ {
+ fun(const F& f) : value(f){}
+ F value;
+ };
+
+ template<typename T, typename F1>
+ typename ::boost::mpl::apply1<result_of_modulo::fun<T>, F1>::type
+ operator%(T const& t, put_modulo_aux::fun<F1> const& h)
+ {
+ typedef result_of_modulo::fun<T> meta_;
+ typedef typename ::boost::mpl::apply1<meta_, F1>::type result_;
+ return result_( t.container(), h.value, t.modifier );
+ }
+
+ struct kwd_fun{
+
+ template<typename F>
+ put_modulo_aux::fun<F> operator=(F const& f)const
+ {
+ return put_modulo_aux::fun<F>( f );
+ }
+
+ };
+
+}// put_modulo_aux
+namespace{
+ const put_modulo_aux::kwd_fun _fun = put_modulo_aux::kwd_fun();
+}
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/assign_v2/boost/assign/v2/put/modulo/fun_modifier.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modulo/fun_modifier.hpp 2011-01-27 18:51:38 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,39 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_FUN_MODIFIER_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_MODULO_FUN_MODIFIER_ER_2010_HPP
+#include <boost/mpl/apply.hpp>
+#include <boost/assign/v2/put/modulo/fun.hpp>
+#include <boost/assign/v2/put/modulo/modifier.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace result_of_modulo{
+
+ template<typename T> struct fun_modifier
+ {
+ template<typename F, typename Tag>
+ struct apply
+ {
+ typedef result_of_modulo::fun<T> meta_fun_;
+ typedef typename ::boost::mpl::apply1< meta_fun_, F>::type new_t_;
+ typedef result_of_modulo::modifier<new_t_> modifier_;
+ typedef typename ::boost::mpl::apply1< modifier_, Tag>::type type;
+ };
+ };
+
+}// result_of_modulo
+}// v2
+}// assign
+}// boost
+
+#endif
+

Added: sandbox/assign_v2/boost/assign/v2/put/modulo/generic.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modulo/generic.hpp 2011-01-27 18:51:38 EST (Thu, 27 Jan 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_MODULO_GENERIC_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_MODULO_GENERIC_ER_2010_HPP
+#include <boost/typeof/typeof.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace result_of_modulo{
+
+ // Is this needed?
+ template<typename T>
+ struct generic_
+ {
+
+ template<typename P>
+ struct apply
+ {
+ static T t;
+ static P p;
+ typedef BOOST_TYPEOF_TPL( t % p ) type;
+ };
+
+ };
+
+}// result_of_modulo
+}// v2
+}// assign
+}// boost
+
+#endif
+

Added: sandbox/assign_v2/boost/assign/v2/put/modulo/modifier.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/modulo/modifier.hpp 2011-01-27 18:51:38 EST (Thu, 27 Jan 2011)
@@ -0,0 +1,65 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_MODULO_MODIFIER_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/modifier.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace result_of_modulo{
+
+ template<typename D> struct modifier /* Specialize on D(erived) */{
+ template<typename Tag> struct apply{};
+ };
+
+}// result_of_modulo
+namespace put_modulo_aux{
+
+ template<typename Tag> struct modifier
+ {
+ modifier(){}
+ modifier(Tag const& t) : modifier_tag( t ){}
+ Tag modifier_tag;
+ };
+
+ template<typename T, typename NewTag>
+ typename ::boost::mpl::apply1<result_of_modulo::modifier<T>, NewTag>::type
+ operator%(T const& t, put_modulo_aux::modifier<NewTag> const& h )
+ {
+ typedef result_of_modulo::modifier<T> meta_;
+
+ typedef typename ::boost::mpl::apply1<meta_, NewTag>::type result_;
+ typedef put_aux::modifier<NewTag> modifier_;
+ return result_( t.container(), t.fun, modifier_( h.modifier_tag ) );
+ }
+
+ struct kwd_modifier
+ {
+ template<typename Tag>
+ modifier<Tag> operator=( Tag const& t)const
+ {
+ return modifier<Tag>( t );
+ }
+ };
+
+}// put_modulo_aux
+namespace{
+ put_modulo_aux::kwd_modifier const _modifier
+ = put_modulo_aux::kwd_modifier();
+}
+}// v2
+}// assign
+}// boost
+
+#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