Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69793 - in sandbox/assign_v2/boost/assign/v2/put/deque: . cpp03
From: erwann.rogard_at_[hidden]
Date: 2011-03-09 16:17:56


Author: e_r
Date: 2011-03-09 16:17:52 EST (Wed, 09 Mar 2011)
New Revision: 69793
URL: http://svn.boost.org/trac/boost/changeset/69793

Log:
upd assign_v2
Added:
   sandbox/assign_v2/boost/assign/v2/put/deque/adapter.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/deque/cpp03/
   sandbox/assign_v2/boost/assign/v2/put/deque/cpp03/csv_deque.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/deque/cpp03/deque.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/deque/csv_deque.hpp (contents, props changed)
   sandbox/assign_v2/boost/assign/v2/put/deque/deque.hpp (contents, props changed)
Removed:
   sandbox/assign_v2/boost/assign/v2/put/deque/cont.hpp
   sandbox/assign_v2/boost/assign/v2/put/deque/csv.hpp
   sandbox/assign_v2/boost/assign/v2/put/deque/functor.hpp
   sandbox/assign_v2/boost/assign/v2/put/deque/replace_parameter.hpp

Added: sandbox/assign_v2/boost/assign/v2/put/deque/adapter.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/deque/adapter.hpp 2011-03-09 16:17:52 EST (Wed, 09 Mar 2011)
@@ -0,0 +1,148 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_DEQUE_ADAPTER_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_DEQUE_ADAPTER_ER_2010_HPP
+#include <deque>
+#include <boost/assign/v2/put/frame/crtp.hpp>
+#include <boost/assign/v2/put/frame/modifier.hpp>
+#include <boost/assign/v2/put/frame/replace_parameter.hpp>
+#include <boost/assign/v2/put/deque/fwd.hpp>
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+#include <boost/range/iterator.hpp>
+#include <boost/range/size.hpp>
+#include <boost/range/size_type.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+
+ template<typename T>
+ struct deque_impl{ typedef std::deque<T> type; };
+
+ template<typename T, typename F, typename Tag>
+ class deque_adapter :
+ public crtp<
+ typename deque_impl<T>::type, F, Tag,
+ deque_adapter<T, F, Tag>
+ >
+ {
+ typedef typename deque_impl<T>::type impl_;
+ typedef impl_ const cimpl_;
+ typedef crtp<impl_, F, Tag, deque_adapter> put_crtp_;
+
+ typedef put_aux::modifier<Tag> modifier_;
+
+ public:
+
+ typedef T value_type;
+ typedef typename boost::range_size<impl_>::type size_type;
+ typedef typename boost::range_iterator<impl_>::type iterator;
+ typedef typename boost::range_iterator<cimpl_>::type const_iterator;
+
+ // Construct
+ deque_adapter(){}
+ explicit deque_adapter(const F& f) : put_crtp_( f ){}
+ explicit deque_adapter(impl_ const& v, F const& f): put_crtp_( f ), impl( v )
+ {
+ // Required by crtp when Tag or F is modified.
+ }
+
+ explicit deque_adapter( impl_ const& v, F const& f, modifier_ const& m )
+ : put_crtp_( f, m ), impl( v )
+ {
+ // Required by crtp when Tag or F is modified.
+ }
+
+ // Deque interface
+ iterator begin(){
+ return boost::begin( this->impl );
+ }
+ iterator end(){
+ return boost::end( this->impl );
+ }
+ const_iterator begin()const{
+ return boost::begin( this->impl );
+ }
+ const_iterator end()const{
+ return boost::end( this->impl );
+ }
+
+ typedef typename impl_::reference reference;
+ typedef typename impl_::const_reference const_reference;
+ typedef typename impl_::difference_type difference_type;
+
+ size_type size()const{
+ return this->container().size();
+ }
+ size_type max_size()const{
+ return this->container().max_size();
+ }
+ bool empty()const{
+ return this->container().empty();
+ }
+ reference operator[](size_type n){
+ return this->container()[n];
+ }
+ const_reference operator[](size_type n)const{
+ return this->container()[n];
+ }
+ reference front(){
+ return this->container().front();
+ }
+ const_reference front()const{
+ return this->container().front();
+ }
+ reference back(){
+ return this->container().back();
+ }
+ const_reference back()const{
+ return this->container().back();
+ }
+ void pop_front(){
+ this->container().pop_front();
+ }
+ void pop_back(){
+ this->container().pop_back();
+ }
+ void swap(deque_adapter& that){
+ this->container().swap( that.container() );
+ }
+
+ // Note : the modifiers such as push_back() are ommitted as they
+ // accessible through the put interface.
+
+ impl_& container()const{ return this->impl; }
+ protected:
+ mutable impl_ impl;
+
+ };
+
+ template<typename T, typename F, typename Tag>
+ struct replace_fun< deque_adapter<T, F, Tag> >
+ {
+ template<typename F1>
+ struct apply{ typedef deque_adapter<T, F1, Tag> type; };
+ };
+
+ template<typename T, typename F, typename Tag>
+ struct replace_modifier_tag< deque_adapter<T, F, Tag> >
+ {
+ template<typename Tag1>
+ struct apply{ typedef deque_adapter<T, F, Tag1> type; };
+ };
+
+}// put_aux
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_PUT_DEQUE_ADAPTER_ER_2010_HPP

Deleted: sandbox/assign_v2/boost/assign/v2/put/deque/cont.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/deque/cont.hpp 2011-03-09 16:17:52 EST (Wed, 09 Mar 2011)
+++ (empty file)
@@ -1 +0,0 @@
-// TODO remove file
\ No newline at end of file

Added: sandbox/assign_v2/boost/assign/v2/put/deque/cpp03/csv_deque.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/deque/cpp03/csv_deque.hpp 2011-03-09 16:17:52 EST (Wed, 09 Mar 2011)
@@ -0,0 +1,48 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_DEQUE_CPP03_CSV_DEQUE_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_DEQUE_CPP03_CSV_DEQUE_ER_2010_HPP
+#include <boost/assign/v2/detail/config/limit_csv_arity.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/preprocessor/repetition.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+
+#define BOOST_ASSIGN_V2_MACRO1(z, i, data) ( BOOST_PP_CAT(_, i) )
+#define BOOST_ASSIGN_V2_MACRO2(z, N, data)\
+ template<typename T>\
+ typename result_of::csv_deque<T>::type\
+ csv_deque( BOOST_PP_ENUM_PARAMS(N, T const & _) )\
+ {\
+ typedef typename boost::decay<T>::type decay_;\
+ return deque<decay_>( v2::_nil ) BOOST_PP_REPEAT(N, BOOST_ASSIGN_V2_MACRO1, ~ );\
+ }\
+/**/
+BOOST_PP_REPEAT_FROM_TO(
+ 1,
+ BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_CSV_ARITY),
+ BOOST_ASSIGN_V2_MACRO2,
+ ~
+)
+#undef BOOST_ASSIGN_V2_MACRO1
+#undef BOOST_ASSIGN_V2_MACRO2
+
+}// put_aux
+
+using put_aux::csv_deque;
+
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_PUT_DEQUE_CPP03_CSV_DEQUE_ER_2010_HPP

Added: sandbox/assign_v2/boost/assign/v2/put/deque/cpp03/deque.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/deque/cpp03/deque.hpp 2011-03-09 16:17:52 EST (Wed, 09 Mar 2011)
@@ -0,0 +1,91 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_DEQUE_CPP03_DEQUE_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_DEQUE_CPP03_DEQUE_ER_2010_HPP
+#include <boost/assign/v2/detail/config/limit_arity.hpp>
+#include <boost/assign/v2/detail/config/limit_lvalue_const_arity.hpp>
+#include <boost/assign/v2/detail/keyword/nil.hpp>
+#include <boost/assign/v2/detail/pp/parameter_list.hpp>
+#include <boost/assign/v2/put/deque/fwd.hpp>
+#include <boost/preprocessor/arithmetic.hpp>
+#include <boost/preprocessor/repetition.hpp>
+#include <boost/preprocessor/seq.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+
+ template<typename T>
+ typename result_of::deque<T>::type
+ deque()
+ {
+ return deque<T>( v2::_nil )();
+ }
+
+// Overloads for any mixture of const/non-const arguments
+
+#define BOOST_ASSIGN_V2_MACRO1(r, SeqU)\
+ template<typename T, BOOST_ASSIGN_V2_TPL_PARAMETER_LIST(SeqU)>\
+ typename result_of::deque<T>::type\
+ deque( BOOST_ASSIGN_V2_PARAMETER_LIST(SeqU, _) ){\
+ return deque<T>( v2::_nil )(\
+ BOOST_ASSIGN_V2_ARG_LIST(SeqU, _)\
+ );\
+ }\
+/**/
+#define BOOST_ASSIGN_V2_MACRO2(z, n, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT(\
+ BOOST_ASSIGN_V2_MACRO1,\
+ BOOST_PP_SEQ_FIRST_N(BOOST_PP_INC(n), BOOST_ASSIGN_V2_SEQ_TPL_BINARY_ARG_LIST)\
+) \
+/**/
+BOOST_PP_REPEAT(
+ BOOST_ASSIGN_V2_LIMIT_LVALUE_CONST_ARITY,
+ BOOST_ASSIGN_V2_MACRO2,
+ ~
+)
+#undef BOOST_ASSIGN_V2_MACRO1
+#undef BOOST_ASSIGN_V2_MACRO2
+
+// Overloads for all const and all non-const arguments
+
+#define BOOST_ASSIGN_V2_MACRO(z, N, data) \
+\
+ template<typename T BOOST_PP_ENUM_TRAILING_PARAMS(N, typename U)> \
+ typename result_of::deque<T>::type\
+ deque( BOOST_PP_ENUM_BINARY_PARAMS(N, U, &_) ){ \
+ return deque<T>( v2::_nil )( BOOST_PP_ENUM_PARAMS(N, _) ); \
+ } \
+\
+ template<typename T BOOST_PP_ENUM_TRAILING_PARAMS(N, typename U)> \
+ typename result_of::deque<T>::type\
+ deque( BOOST_PP_ENUM_BINARY_PARAMS(N, const U, &_) ){ \
+ return deque<T>( v2::_nil )( BOOST_PP_ENUM_PARAMS(N, _) ); \
+ } \
+\
+/**/
+BOOST_PP_REPEAT_FROM_TO(
+ BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_LVALUE_CONST_ARITY),
+ BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_ARITY),
+ BOOST_ASSIGN_V2_MACRO,
+ ~
+)
+#undef BOOST_ASSIGN_V2_MACRO
+
+}// put_aux
+
+using put_aux::deque;
+
+}// v2
+}// assign
+}// boost
+
+#endif // BOOST_ASSIGN_V2_PUT_DEQUE_CPP03_ER_2010_HPP

Deleted: sandbox/assign_v2/boost/assign/v2/put/deque/csv.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/deque/csv.hpp 2011-03-09 16:17:52 EST (Wed, 09 Mar 2011)
+++ (empty file)
@@ -1 +0,0 @@
-// TODO remove file
\ No newline at end of file

Added: sandbox/assign_v2/boost/assign/v2/put/deque/csv_deque.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/deque/csv_deque.hpp 2011-03-09 16:17:52 EST (Wed, 09 Mar 2011)
@@ -0,0 +1,77 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_DEQUE_CSV_DEQUE_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_DEQUE_CSV_DEQUE_ER_2010_HPP
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#include <boost/assign/v2/put/deque/deque.hpp>
+#include <boost/type_traits/decay.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#endif
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+namespace result_of{
+
+ template<typename T>
+ struct csv_deque : result_of::deque<
+ typename boost::decay<
+ typename boost::remove_cv<T>::type
+ >::type
+ >{};
+
+}// result_of
+}// put_aux
+namespace result_of{
+
+ template<typename T>
+ struct csv_deque : put_aux::result_of::deque<T>{};
+
+}// result_of
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+namespace put_aux{
+
+ template<typename T, typename R>
+ void csv_deque_impl(R& r){}
+
+ template<typename T, typename R, typename...Args>
+ void csv_deque_impl(R& r, T const& t, Args&&...args)
+ {
+ r( t );
+ csv_deque_impl<T>(r, std::forward<Args>( args )... );
+ }
+
+ template<typename T, typename... Args>
+ typename result_of::csv_deque<T>::type
+ csv_deque(const T& t, Args const& ... args)
+ {
+ result_of::csv_deque<T>::type result;
+ csv_deque_impl<T>(result, t, args...);
+ return result;
+ }
+}// put_aux
+
+using put_aux::deque;
+
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+}// v2
+}// assign
+}// boost
+
+#if !BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <boost/assign/v2/put/deque/cpp03/csv_deque.hpp>
+#endif
+
+
+#endif // BOOST_ASSIGN_V2_PUT_DEQUE_CSV_DEQUE_ER_2010_HPP

Added: sandbox/assign_v2/boost/assign/v2/put/deque/deque.hpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/boost/assign/v2/put/deque/deque.hpp 2011-03-09 16:17:52 EST (Wed, 09 Mar 2011)
@@ -0,0 +1,81 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_DEQUE_DEQUE_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_DEQUE_DEQUE_ER_2010_HPP
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#include <boost/assign/v2/detail/keyword/nil.hpp>
+#include <boost/assign/v2/put/deduce/fun.hpp>
+#include <boost/assign/v2/put/deduce/modifier/tag.hpp>
+#include <boost/assign/v2/put/deduce/modifier/dependee.hpp>
+//#include <boost/assign/v2/put/deque/fwd.hpp>
+#include <boost/assign/v2/put/deque/adapter.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+namespace result_of{
+
+ template<typename T>
+ struct deque
+ {
+ typedef typename boost::remove_cv<T>::type t_;
+ typedef typename put_aux::deque_impl<t_>::type impl_;
+ typedef typename put_aux::deduce_fun<impl_>::type f_;
+ typedef typename put_aux::deduce_modifier_tag<impl_>::type modifier_tag_;
+ typedef put_aux::deque_adapter<t_,f_,modifier_tag_> type;
+ };
+
+}// result_of
+
+ template<typename T>
+ typename result_of::deque<T>::type
+ deque( keyword_aux::nil )
+ {
+ return typename result_of::deque<T>::type();
+ }
+
+}// put_aux
+namespace result_of{
+
+ template<typename T>
+ struct deque
+ : put_aux::result_of::deque<T>
+ {};
+
+}// result_of
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+namespace put_aux{
+
+ template<typename T, typename...Args>
+ typename result_of::deque<T>::type
+ deque(Args&&...args)
+ {
+ return deque<T>( v2::_nil )( std::forward<Args>(args)... );
+ }
+
+}// put_aux
+
+using put_aux::deque;
+
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+}// v2
+}// assign
+}// boost
+
+#if !BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <boost/assign/v2/put/deque/cpp03/deque.hpp>
+#endif
+
+#endif // BOOST_ASSIGN_V2_PUT_DEQUE_DEQUE_ER_2010_HPP

Deleted: sandbox/assign_v2/boost/assign/v2/put/deque/functor.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/deque/functor.hpp 2011-03-09 16:17:52 EST (Wed, 09 Mar 2011)
+++ (empty file)
@@ -1 +0,0 @@
-// TODO remove file
\ No newline at end of file

Deleted: sandbox/assign_v2/boost/assign/v2/put/deque/replace_parameter.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/deque/replace_parameter.hpp 2011-03-09 16:17:52 EST (Wed, 09 Mar 2011)
+++ (empty file)
@@ -1 +0,0 @@
-// TODO remove file
\ No newline at end of file


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