Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69940 - in sandbox/assign_v2/boost/assign/v2/put: . fun
From: erwann.rogard_at_[hidden]
Date: 2011-03-13 10:28:21


Author: e_r
Date: 2011-03-13 10:28:18 EDT (Sun, 13 Mar 2011)
New Revision: 69940
URL: http://svn.boost.org/trac/boost/changeset/69940

Log:
upd assign_v2
Added:
   sandbox/assign_v2/boost/assign/v2/put/fun/
   sandbox/assign_v2/boost/assign/v2/put/fun/deduce.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/fun/modulo.hpp (contents, props changed)
Text files modified:
   sandbox/assign_v2/boost/assign/v2/put/fun.hpp | 184 ---------------------------------------
   sandbox/assign_v2/boost/assign/v2/put/pipe.hpp | 1
   2 files changed, 2 insertions(+), 183 deletions(-)

Modified: sandbox/assign_v2/boost/assign/v2/put/fun.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/fun.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/fun.hpp 2011-03-13 10:28:18 EDT (Sun, 13 Mar 2011)
@@ -9,187 +9,7 @@
 //////////////////////////////////////////////////////////////////////////////
 #ifndef BOOST_ASSIGN_V2_PUT_FUN_ER_2010_HPP
 #define BOOST_ASSIGN_V2_PUT_FUN_ER_2010_HPP
-#include <boost/assign/v2/detail/pp/ignore.hpp>
-#include <boost/assign/v2/detail/keyword/ignore.hpp>
-#include <boost/assign/v2/put/adapter/fwd.hpp>
-#include <boost/assign/v2/put/adapter/replace_parameter.hpp>
-#include <boost/assign/v2/put/fun/modulo/meta.hpp>
-#include <boost/mpl/apply.hpp>
-
-namespace boost{
-namespace assign{
-namespace v2{
-namespace put_aux{
-namespace result_of{
-
- template<typename D>
- struct modulo_fun{
-
- typedef put_aux::replace_fun<D> meta_;
-
- template<typename F>
- struct apply : ::boost::mpl::apply1<meta_, F>{};
-
- };
-
-}// result_of
-
- template<typename F = keyword_aux::ignore>
- struct modulo_fun
- {
- modulo_fun(){}
- modulo_fun(F f) : f_( f ){}
-
- F const& fun()const{ return this->f_; }
-
- private:
- F f_;
- };
-
- template<typename C, typename F, typename Tag, typename D, typename F1>
- typename ::boost::mpl::apply1<result_of::modulo_fun<D>, F1>::type
- operator%(
- crtp<C, F, Tag, D> const& lhs,
- modulo_fun<F1> const& rhs
- )
- {
- typedef result_of::modulo_fun<D> meta_;
- typedef typename ::boost::mpl::apply1<meta_, F1>::type result_;
- return result_( lhs.container(), rhs.fun(), lhs.modifier );
- }
-
- struct keyword_fun{
-
- template<typename F>
- modulo_fun<F> operator=(F const& f)const{
- return modulo_fun<F>( f );
- }
-
- };
-
-}// put_aux
-namespace{
- const put_aux::keyword_fun _fun = put_aux::keyword_fun();
-}
-//[syntax_put_fun
-namespace result_of{
-
- template<typename D>
- struct modulo_fun
-//<-
- : put_aux::result_of::modulo_fun<D>
-//->
- {};
-
-}// result_of
-//]
-
-//[semantics_put_fun
-/*`
-
-[*Notation]
-
-See __link_put_adapter_crtp__.
-
-[*Expressions]
-
-[table
- [[Expression][Result type][Description]]
- [
- [`__put_adapter__ % ( _fun = f )`]
- [`::boost::mpl::apply1<result_of::modulo_fun<D>, F>::type`]
- [Replaces `__put_adapter__`'s functor with `f`]
- ]
-]
-*/
-//]
-
-}// v2
-}// assign
-}// boost
-
-#include <boost/preprocessor/cat.hpp>
-
-#define BOOST_ASSIGN_V2_PUT_FUN_alias(NAME, FUN)\
-namespace boost{\
-namespace assign{\
-namespace v2{\
-namespace put_aux{\
-\
- template<typename T>\
- modulo_fun< FUN > BOOST_PP_CAT(_,NAME)(){ return v2::_fun = FUN(); }\
-\
-}\
-using put_aux::BOOST_PP_CAT(_,NAME);\
-}\
-}\
-}\
-/**/
-
-#include <boost/assign/v2/detail/functor/constructor.hpp>
-#define BOOST_ASSIGN_V2_fun functor_aux::constructor<T>
-BOOST_ASSIGN_V2_PUT_FUN_alias(constructor, BOOST_ASSIGN_V2_fun)
-#undef BOOST_ASSIGN_V2_fun
-
-#include <boost/assign/v2/detail/functor/new.hpp>
-#define BOOST_ASSIGN_V2_fun functor_aux::new_<T>
-BOOST_ASSIGN_V2_PUT_FUN_alias(new, BOOST_ASSIGN_V2_fun)
-#undef BOOST_ASSIGN_V2_fun
-
-#undef BOOST_ASSIGN_V2_PUT_FUN_alias
-
-#include <boost/lambda/lambda.hpp>
-#include <boost/typeof/typeof.hpp>
-namespace boost{
-namespace assign{
-namespace v2{
-namespace put_aux{
-
- typedef BOOST_TYPEOF( ( _fun = ::boost::lambda::_1 ) ) keyword_identity;
-
-}// put_aux
-namespace {
-
- put_aux::keyword_identity const _identity = ( _fun = ::boost::lambda::_1 );
-
-}
-}// v2
-}// assign
-}// boost
-
-
-//[aliases_put_fun
-/*`
-[*Synopsis]
-``
-const __unspecified__ _construct;
-const __unspecified__ _identity;
-const __unspecified__ _new;
-``
-
-[*Notation]
-
-See __link_put_adapter_crtp__.
-
-[*Semantics]
-
-[table
- [[Expression][Result type]]
- [
- [`__put_adapter__ % _identity`]
- [Replaces `__put_adapter__`'s functor with an identity functor]
- ]
- [
- [`__put_adapter__ % _constructor<T>()`]
- [Replaces `__put_adapter__`'s functor with a constructor for `T`]
- ]
- [
- [`__put_adapter__ % _new<T>()`]
- [Replaces `__put_adapter__`'s functor with a functor returning a pointer for `T`]
- ]
-]
-*/
-//]
-
+#include <boost/assign/v2/put/fun/deduce.hpp>
+#include <boost/assign/v2/put/fun/modulo.hpp>
 
 #endif // BOOST_ASSIGN_V2_PUT_FUN_ER_2010_HPP

Added: sandbox/assign_v2/boost/assign/v2/put/fun/deduce.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/fun/deduce.hpp 2011-03-13 10:28:18 EDT (Sun, 13 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_FUN_DEDUCE_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_FUN_DEDUCE_ER_2010_HPP
+#include <boost/assign/v2/detail/traits/container/is_ptr_container.hpp>
+#include <boost/assign/v2/detail/traits/container/value.hpp>
+#include <boost/assign/v2/detail/functor/constructor.hpp>
+#include <boost/assign/v2/detail/functor/new.hpp>
+#include <boost/mpl/eval_if.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+
+ template<typename C>
+ struct deduce_fun_pointer
+ {
+ typedef typename v2::container_traits::value<C>::type value_type;
+ typedef functor_aux::new_<value_type> type;
+ };
+
+ template<typename C>
+ struct deduce_fun_value
+ {
+ typedef typename v2::container_traits::value<C>::type value_type;
+ typedef functor_aux::constructor<value_type> type;
+ };
+
+ template<typename C>
+ struct deduce_fun : boost::mpl::eval_if<
+ container_traits::is_ptr_container<C>,
+ deduce_fun_pointer<C>,
+ deduce_fun_value<C>
+ >
+ {};
+
+}// put_aux
+}// v2
+}// assign
+}// boost
+
+#endif BOOST_ASSIGN_V2_PUT_FUN_DEDUCE_ER_2010_HPP

Added: sandbox/assign_v2/boost/assign/v2/put/fun/modulo.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/fun/modulo.hpp 2011-03-13 10:28:18 EDT (Sun, 13 Mar 2011)
@@ -0,0 +1,140 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_FUN_MODULO_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_FUN_MODULO_ER_2010_HPP
+#include <boost/assign/v2/detail/pp/ignore.hpp>
+#include <boost/assign/v2/detail/keyword/ignore.hpp>
+#include <boost/assign/v2/put/adapter/fwd.hpp>
+#include <boost/assign/v2/put/adapter/replace_parameter.hpp>
+#include <boost/mpl/apply.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+namespace result_of{
+
+ template<typename D>
+ struct modulo_fun{
+
+ typedef put_aux::replace_fun<D> meta_;
+
+ template<typename F>
+ struct apply : ::boost::mpl::apply1<meta_, F>{};
+
+ };
+
+}// result_of
+
+ template<typename F = keyword_aux::ignore>
+ struct modulo_fun
+ {
+ modulo_fun(){}
+ modulo_fun(F f) : f_( f ){}
+
+ F const& fun()const{ return this->f_; }
+
+ private:
+ F f_;
+ };
+
+ template<typename C, typename F, typename Tag, typename D, typename F1>
+ typename ::boost::mpl::apply1<result_of::modulo_fun<D>, F1>::type
+ operator%(
+ crtp<C, F, Tag, D> const& lhs,
+ modulo_fun<F1> const& rhs
+ )
+ {
+ typedef result_of::modulo_fun<D> meta_;
+ typedef typename ::boost::mpl::apply1<meta_, F1>::type result_;
+ return result_( lhs.container(), rhs.fun(), lhs.modifier );
+ }
+
+ struct keyword_fun{
+
+ template<typename F>
+ modulo_fun<F> operator=(F const& f)const{
+ return modulo_fun<F>( f );
+ }
+
+ };
+
+}// put_aux
+namespace{
+ const put_aux::keyword_fun _fun = put_aux::keyword_fun();
+}
+//[syntax_put_fun
+namespace result_of{
+
+ template<typename D>
+ struct modulo_fun
+//<-
+ : put_aux::result_of::modulo_fun<D>
+//->
+ {};
+
+}// result_of
+//]
+
+
+}// v2
+}// assign
+}// boost
+
+#include <boost/preprocessor/cat.hpp>
+
+#define BOOST_ASSIGN_V2_PUT_FUN_alias(NAME, FUN)\
+namespace boost{\
+namespace assign{\
+namespace v2{\
+namespace put_aux{\
+\
+ template<typename T>\
+ modulo_fun< FUN > BOOST_PP_CAT(_,NAME)(){ return v2::_fun = FUN(); }\
+\
+}\
+using put_aux::BOOST_PP_CAT(_,NAME);\
+}\
+}\
+}\
+/**/
+
+#include <boost/assign/v2/detail/functor/constructor.hpp>
+#define BOOST_ASSIGN_V2_fun functor_aux::constructor<T>
+BOOST_ASSIGN_V2_PUT_FUN_alias(constructor, BOOST_ASSIGN_V2_fun)
+#undef BOOST_ASSIGN_V2_fun
+
+#include <boost/assign/v2/detail/functor/new.hpp>
+#define BOOST_ASSIGN_V2_fun functor_aux::new_<T>
+BOOST_ASSIGN_V2_PUT_FUN_alias(new, BOOST_ASSIGN_V2_fun)
+#undef BOOST_ASSIGN_V2_fun
+
+#undef BOOST_ASSIGN_V2_PUT_FUN_alias
+
+#include <boost/lambda/lambda.hpp>
+#include <boost/typeof/typeof.hpp>
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+
+ typedef BOOST_TYPEOF( ( _fun = ::boost::lambda::_1 ) ) keyword_identity;
+
+}// put_aux
+namespace {
+
+ put_aux::keyword_identity const _identity = ( _fun = ::boost::lambda::_1 );
+
+}
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_PUT_FUN_MODULO_ER_2010_HPP

Modified: sandbox/assign_v2/boost/assign/v2/put/pipe.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/pipe.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/pipe.hpp 2011-03-13 10:28:18 EDT (Sun, 13 Mar 2011)
@@ -11,6 +11,5 @@
 #define BOOST_ASSIGN_V2_PUT_PIPE_ER_2010_HPP
 #include <boost/assign/v2/put/pipe/csv_put.hpp>
 #include <boost/assign/v2/put/pipe/put.hpp>
-//#include <boost/assign/v2/put/pipe/range.hpp>
 
 #endif // BOOST_ASSIGN_V2_PUT_PIPE_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