Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72510 - sandbox/assign_v2/boost/assign/v2/put
From: erwann.rogard_at_[hidden]
Date: 2011-06-09 11:36:59


Author: e_r
Date: 2011-06-09 11:36:59 EDT (Thu, 09 Jun 2011)
New Revision: 72510
URL: http://svn.boost.org/trac/boost/changeset/72510

Log:
upd assign_v2
Added:
   sandbox/assign_v2/boost/assign/v2/put/do_csv_put.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/do_put.hpp (contents, props changed)

Added: sandbox/assign_v2/boost/assign/v2/put/do_csv_put.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/do_csv_put.hpp 2011-06-09 11:36:59 EDT (Thu, 09 Jun 2011)
@@ -0,0 +1,127 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2011 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_DO_CSV_PUT_ER_2011_HPP
+#define BOOST_ASSIGN_V2_PUT_DO_CSV_PUT_ER_2011_HPP
+#include <boost/assign/v2/deque/csv_deque.hpp>
+#include <boost/assign/v2/put/do_put.hpp>
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#include <tuple>
+#include <boost/assign/v2/support/pp/ignore.hpp>
+#include <boost/assign/v2/support/traits/type/add_ref_const.hpp>
+#include <boost/assign/v2/support/mpl/variadic_args_to_indices.hpp>
+#include <boost/type_traits/add_const.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+//[syntax_do_csv_put
+namespace interpreter_aux{
+namespace result_of{
+
+//<-
+ template<typename Options, int I>
+ struct do_csv_put_helper
+ {
+ template<typename CastHolder, typename ArgsHolder>
+ struct apply{};
+
+ template<typename...Cast, typename... Args>
+ struct apply<pack_holder<Cast...>, pack_holder<Args...> >
+ {
+ typedef pack_holder<
+ typename type_traits::add_ref_const<Cast>::type...
+ > head_;
+ typedef pack_holder<Args...> tail_;
+ typedef typename csv_cast<I, head_, tail_>::type cast_;
+
+ typedef typename csv_tuple_head<
+ I, pack_holder<>, pack_holder<Args...>
+ >::type tuple_;
+ typedef typename result_of::csv_deque<tuple_>::type cont_;
+ typedef put_for_each_adapter<
+ typename boost::add_const<cont_>::type,
+ Options,
+ I
+ > type;
+
+ static type call(Options const& options, Args&&... args)
+ {
+ return type( options, v2::csv_deque<tuple_, I>(
+ std::forward<Args>( args )...
+ ) );
+ }
+ };
+ };
+
+//->
+ template<
+ typename Options,
+ typename CastHolder, typename ArgsHolder,
+ int I
+ >
+ struct do_csv_put/*<-*/
+ : do_csv_put_helper<Options, I>:: template apply<
+ CastHolder, ArgsHolder
+ >
+ {}/*->*/;
+
+}// result_of
+
+ template<typename Options, int I, typename ...Cast, typename...Args>
+/*<-*/
+ typename result_of::do_csv_put<
+ Options,
+ pack_holder<Cast...>,
+ pack_holder<Args...>,
+ I
+ >::type/*->*/
+ /*<-*/BOOST_ASSIGN_V2_IGNORE(/*->*/unspecified/*<-*/)/*->*/
+ do_csv_put(Args&&... args)/*<-*/
+ {
+ typedef result_of::do_csv_put<
+ Options,
+ pack_holder<Cast...>,
+ pack_holder<Args...>,
+ I
+ > meta_;
+ return meta_::call( Options(), std::forward<Args>( args )... );
+ }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
+ template<int I, typename ...Cast, typename...Args>
+/*<-*/
+ typename result_of::do_csv_put<
+ empty_list_option_,
+ pack_holder<Cast...>,
+ pack_holder<Args...>,
+ I
+ >::type/*->*/
+ /*<-*/BOOST_ASSIGN_V2_IGNORE(/*->*/unspecified/*<-*/)/*->*/
+ do_csv_put(Args&&... args)/*<-*/
+ {
+ return do_csv_put<empty_list_option_, I, Cast...>(
+ std::forward<Args>(args)...
+ );
+ }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
+}// interpreter_aux
+
+using interpreter_aux::do_csv_put;
+
+//]
+}// v2
+}// assign
+}// boost
+
+#else
+#include <boost/assign/v2/put/cpp03/do_csv_put.hpp>
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+#endif // BOOST_ASSIGN_V2_PUT_DO_CSV_PUT_ER_2011_HPP

Added: sandbox/assign_v2/boost/assign/v2/put/do_put.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/do_put.hpp 2011-06-09 11:36:59 EDT (Thu, 09 Jun 2011)
@@ -0,0 +1,163 @@
+//////////////////////////////////////////////////////////////////////////////
+// Boost.Assign v2 //
+// //
+// Copyright (C) 2003-2004 Thorsten Ottosen //
+// Copyright (C) 2011 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_DO_PUT_ER_2011_HPP
+#define BOOST_ASSIGN_V2_PUT_DO_PUT_ER_2011_HPP
+#include <boost/assign/v2/support/pp/ignore.hpp>
+#include <boost/range/iterator_range.hpp>
+#include <boost/assign/v2/put/put.hpp>
+#include <boost/assign/v2/support/pp/forward.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#endif
+
+namespace boost{
+namespace assign{
+namespace v2{
+//[syntax_do_put
+namespace interpreter_aux{
+
+//<-
+ template<typename R>
+ struct do_put_super
+ {
+ typedef boost::iterator_range<
+ typename boost::range_iterator<
+ typename type_traits::param<R>::type
+ >::type
+ > type;
+ };
+//->
+
+ template<
+ typename R, typename O = empty_list_option_/*<-*/, int I = 0/*->*/
+ >
+ struct put_for_each_adapter/*<-*/
+ : do_put_super<R>::type/*->*/
+ {
+//<-
+ typedef typename do_put_super<R>::type super_t;
+
+ public:
+
+ put_for_each_adapter( BOOST_ASSIGN_V2_FORWARD_PARAM(R, range) )
+ :super_t( BOOST_ASSIGN_V2_FORWARD_ARG(R, range) )
+ {}
+
+ put_for_each_adapter(
+ O const& o, BOOST_ASSIGN_V2_FORWARD_PARAM(R, range)
+ )
+ :super_t( BOOST_ASSIGN_V2_FORWARD_ARG(R, range) ),
+ options_( o )
+ {}
+
+ put_for_each_adapter(super_t const& super, O const& o)
+ :super_t( super ), options_( o )
+ {}
+
+ O const& options()const{ return this->options_; }
+
+ private:
+ put_for_each_adapter();
+ O options_;
+//->
+ };
+
+ template<typename O = empty_list_option_>
+ struct put_adapter
+ {
+//<-
+ put_adapter(){}
+ put_adapter(O const& o)
+ :options_( o )
+ {}
+//->
+
+ template<typename R>
+ put_for_each_adapter<R, O>
+ for_each( /*<-*/BOOST_ASSIGN_V2_IGNORE(/*->*/R&& range/*<-*/)
+ BOOST_ASSIGN_V2_FORWARD_PARAM( R, range )/*->*/ )const/*<-*/
+ {
+ typedef put_for_each_adapter<R, O> result_;
+ return result_( this->options_, range );
+ }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
+ template<int I, typename R>
+ put_for_each_adapter<R, O, I>
+ for_each( /*<-*/BOOST_ASSIGN_V2_IGNORE(/*->*/R&& range/*<-*/)
+ BOOST_ASSIGN_V2_FORWARD_PARAM( R, range )/*->*/ )const/*<-*/
+ {
+ typedef put_for_each_adapter<R, O, I> result_;
+ return result_( this->options_, range );
+ }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
+ template<typename Options>
+ put_adapter<Options>
+ operator%(Options const& options) const/*<-*/
+ {
+ return put_adapter<Options>( options );
+ }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+//<-
+#if! BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+ // R const&
+
+ template<typename R>
+ put_for_each_adapter<R const, O>
+ for_each( R const& range )const
+ {
+ typedef put_for_each_adapter<R const, O> result_;
+ return result_( this->options_, range );
+ }
+
+ template<int I, typename R>
+ put_for_each_adapter<R const, O, I>
+ for_each( R const& range )const
+ {
+ typedef put_for_each_adapter<R const, O, I> result_;
+ return result_( this->options_, range );
+ }
+#endif
+ private:
+ O options_;
+//->
+ };
+
+ template<typename C, typename R, typename O>
+ C& operator|(C& cont, put_for_each_adapter<R, O> const& a)/*<-*/
+ {
+ return (
+ put( cont ) % a.options()
+ ).for_each( a ).container();
+ }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
+ template<typename C, typename R, typename O, int I>
+ C& operator|(C& cont, put_for_each_adapter<R, O, I> const& a)/*<-*/
+ {
+ return (
+ put( cont ) % a.options()
+ ).template for_each<I>( a ).container();
+ }BOOST_ASSIGN_V2_IGNORE(/*->*/;/*<-*/)/*->*/
+
+}// interpreter_aux
+
+//<-
+namespace{
+//->
+ const interpreter_aux::put_adapter<> _do_put/*<-*/
+ = interpreter_aux::put_adapter<>()/*->*/;
+//<-
+}
+//->
+//]
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_PUT_DO_PUT_ER_2011_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