Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67831 - sandbox/statistics/support/boost/assign/v2/put/deque
From: erwann.rogard_at_[hidden]
Date: 2011-01-08 20:52:56


Author: e_r
Date: 2011-01-08 20:52:54 EST (Sat, 08 Jan 2011)
New Revision: 67831
URL: http://svn.boost.org/trac/boost/changeset/67831

Log:
addg to boost/assign/v2
Added:
   sandbox/statistics/support/boost/assign/v2/put/deque/
   sandbox/statistics/support/boost/assign/v2/put/deque/cont.hpp (contents, props changed)
   sandbox/statistics/support/boost/assign/v2/put/deque/csv.hpp (contents, props changed)
   sandbox/statistics/support/boost/assign/v2/put/deque/functor.hpp (contents, props changed)

Added: sandbox/statistics/support/boost/assign/v2/put/deque/cont.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/assign/v2/put/deque/cont.hpp 2011-01-08 20:52:54 EST (Sat, 08 Jan 2011)
@@ -0,0 +1,177 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_CONT_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_DEQUE_CONT_ER_2010_HPP
+#include <deque>
+#include <boost/range/iterator.hpp>
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+#include <boost/range/size.hpp>
+#include <boost/range/size_type.hpp>
+#include <boost/range/iterator_range.hpp> //iterator_range_detail::
+#include <boost/assign/v2/put.hpp>
+#include <boost/assign/v2/put/generic/result_of_modulo.hpp>
+#include <boost/assign/v2/put/generic/crtp.hpp>
+/*#include <boost/assign/v2/detail/relational_op.hpp>*/
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_deque_aux{
+
+ template<typename T,typename F,typename Tag> class cont;
+
+}// put_deque_aux
+namespace result_of_modulo{
+
+ template<typename T,typename F,typename Tag>
+ struct new_fun<put_deque_aux::cont<T,F,Tag> >
+ {
+
+ template<typename F1>
+ struct apply{ typedef put_deque_aux::cont<T, F1, Tag> type; };
+
+ };
+
+ template<typename T,typename F,typename Tag>
+ struct new_modifier<put_deque_aux::cont<T,F,Tag> >
+ {
+
+ template<typename NewTag>
+ struct apply{ typedef put_deque_aux::cont<T, F, NewTag> type; };
+
+ };
+
+}//result_of_modulo
+namespace put_deque_aux{
+
+ template<typename T>
+ struct impl{ typedef std::deque<T> type; };
+
+ template<typename T, typename F, typename Tag>
+ class cont :
+/* public relational_op_aux::crtp< cont<T, F, Tag> >, */
+ public put_aux::crtp<
+ typename put_deque_aux::impl<T>::type, F, Tag,
+ cont<T, F, Tag>
+ >
+ {
+ typedef typename put_deque_aux::impl<T>::type impl_;
+ typedef impl_ const cimpl_;
+ typedef put_aux::crtp<impl_, F, Tag, cont> 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
+ cont(){}
+ explicit cont(const F& f) : put_crtp_( f ){}
+ explicit cont(impl_ const& v, F const& f): put_crtp_( f ), impl( v )
+ {
+ // Required by crtp when Tag or F is modified.
+ }
+
+ explicit cont( 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->unwrap().size();
+ }
+ size_type max_size()const{
+ return this->unwrap().max_size();
+ }
+ bool empty()const{
+ return this->unwrap().empty();
+ }
+ reference operator[](size_type n){
+ return this->unwrap()[n];
+ }
+ const_reference operator[](size_type n)const{
+ return this->unwrap()[n];
+ }
+ reference front(){
+ return this->unwrap().front();
+ }
+ const_reference front()const{
+ return this->unwrap().front();
+ }
+ reference back(){
+ return this->unwrap().back();
+ }
+ const_reference back()const{
+ return this->unwrap().back();
+ }
+ void pop_front(){
+ this->unwrap().pop_front();
+ }
+ void pop_back(){
+ this->unwrap().pop_back();
+ }
+ void swap(cont& that){
+ this->unwrap().swap( that.unwrap() );
+ }
+
+ // Note : the modifiers such as push_back() are ommitted as they
+ // accessible through the put interface.
+
+ impl_& unwrap()const{ return this->impl; }
+
+ // Relational op
+
+ template<typename R>
+ bool equal_to(const R& r)const{
+ return ::boost::iterator_range_detail::equal(
+ (*this), r );
+ }
+
+ template<typename R>
+ bool less_than(const R& r)const{
+ return ::boost::iterator_range_detail::less_than(
+ (*this), r );
+ }
+
+ protected:
+ mutable impl_ impl;
+
+ };
+
+}// put_deque_aux
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/support/boost/assign/v2/put/deque/csv.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/assign/v2/put/deque/csv.hpp 2011-01-08 20:52:54 EST (Sat, 08 Jan 2011)
@@ -0,0 +1,89 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_DEQUE_CSV_ER_2010_HPP
+#include <boost/type_traits/decay.hpp>
+#include <boost/assign/v2/detail/keyword/nil.hpp>
+#include <boost/assign/v2/put/deque/make.hpp>
+#include <boost/assign/v2/put/deque/cont.hpp>
+#include <boost/assign/v2/detail/config/enable_cpp0x.hpp>
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#else
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/repetition/repeat_from_to.hpp>
+#include <boost/preprocessor/arithmetic/inc.hpp>
+#include <boost/assign/v2/detail/config/limit_csv_arity.hpp>
+#endif
+
+namespace boost{
+namespace assign{
+namespace v2{
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+namespace put_csv_deque_aux{
+
+ template<typename T, typename R>
+ void impl(R& r){}
+
+ template<typename T, typename R, typename...Args>
+ void impl(
+ R& r,
+ T const& t,
+ Args&&...args
+ )
+ {
+ r( t );
+ put_csv_deque_aux::impl<T>(r, std::forward<Args>( args )... );
+ }
+
+}//put_csv_deque_aux
+
+ template<typename T, typename... Args>
+ typename result_of::deque<
+ typename boost::decay<T>::type
+ >::type
+ csv_deque(const T& t, Args const& ... args)
+ {
+ typedef typename boost::decay<T>::type decay_;
+ typedef typename result_of::deque<decay_>::type result_;
+ result_ result = deque<decay_>( v2::_nil );
+ put_csv_deque_aux::impl<T>(result, t, args...);
+ return result;
+ }
+
+#else
+#define MACRO1(z, i, data) ( BOOST_PP_CAT(_, i) )
+#define MACRO2(z, N, data)\
+ template<typename T>\
+ typename result_of::deque<\
+ typename boost::decay<T>::type\
+ >::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, MACRO1, ~ );\
+ }\
+/**/
+BOOST_PP_REPEAT_FROM_TO(
+ 1,
+ BOOST_PP_INC(BOOST_ASSIGN_V2_LIMIT_CSV_ARITY),
+ MACRO2,
+ ~
+)
+#undef MACRO1
+#undef MACRO2
+#endif
+
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/support/boost/assign/v2/put/deque/functor.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/assign/v2/put/deque/functor.hpp 2011-01-08 20:52:54 EST (Sat, 08 Jan 2011)
@@ -0,0 +1,126 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_FUNCTOR_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_DEQUE_FUNCTOR_ER_2010_HPP
+#include <boost/mpl/bool.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/assign/v2/detail/keyword/nil.hpp>
+#include <boost/assign/v2/put/deque/cont.hpp>
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+#include <utility>
+#else
+#include <boost/preprocessor/arithmetic.hpp>
+#include <boost/preprocessor/repetition.hpp>
+#include <boost/preprocessor/seq.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/pp/args.hpp>
+#include <boost/assign/v2/detail/pp/params.hpp>
+#include <boost/assign/v2/detail/pp/seq.hpp>
+#endif
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace result_of{
+
+ template<typename T>
+ struct deque
+ {
+ typedef typename boost::remove_cv<T>::type t_;
+ typedef typename put_deque_aux::impl<t_>::type cont_;
+ typedef result_of::put<cont_> traits_;
+ typedef typename traits_::f_ f_;
+ typedef typename traits_::modifier_tag_ modifier_tag_;
+ typedef put_deque_aux::cont<t_,f_,modifier_tag_> type;
+ };
+
+}// result_of
+
+ template<typename T>
+ typename result_of::deque<T>::type
+ deque( keyword_aux::nil )
+ {
+ typedef typename result_of::deque<T>::type result_;
+ return result_();
+ }
+
+#if BOOST_ASSIGN_V2_ENABLE_CPP0X
+ template<typename T, typename...Args>
+ typename result_of::deque<T>
+ deque(Args&&...args)
+ {
+ return deque<T>(v2::_nil)( std::forward<Args>(args)... );
+ }
+#else
+
+ template<typename T>
+ typename result_of::deque<T>::type
+ deque()
+ {
+ return deque<T>(v2::_nil)();
+ }
+
+#define MACRO1(r, SeqU) \
+ template<typename T, BOOST_ASSIGN_V2_decl_params(SeqU)> \
+ typename result_of::deque<T>::type\
+ deque( BOOST_ASSIGN_V2_decl_args(SeqU) ){ \
+ return deque<T>(v2::_nil)( \
+ BOOST_ASSIGN_V2_args(SeqU) \
+ ); \
+ } \
+/**/
+#define MACRO2(z, n, data) BOOST_PP_SEQ_FOR_EACH_PRODUCT(\
+ MACRO1, \
+ BOOST_PP_SEQ_FIRST_N(BOOST_PP_INC(n), BOOST_ASSIGN_V2_SEQ)\
+) \
+/**/
+BOOST_PP_REPEAT(
+ BOOST_ASSIGN_V2_LIMIT_LVALUE_CONST_ARITY,
+ MACRO2,
+ ~
+)
+#undef MACRO1
+#undef MACRO2
+
+#define 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),
+ MACRO,
+ ~
+)
+#undef MACRO
+
+#endif // BOOST_ASSIGN_V2_ENABLE_CPP0X
+
+
+}// 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