Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66537 - sandbox/statistics/support/boost/assign/v2/put/sub
From: erwann.rogard_at_[hidden]
Date: 2010-11-12 11:36:13


Author: e_r
Date: 2010-11-12 11:36:09 EST (Fri, 12 Nov 2010)
New Revision: 66537
URL: http://svn.boost.org/trac/boost/changeset/66537

Log:
adding dir boost/assign/v2/put/sub
Added:
   sandbox/statistics/support/boost/assign/v2/put/sub/
   sandbox/statistics/support/boost/assign/v2/put/sub/csv.hpp (contents, props changed)
   sandbox/statistics/support/boost/assign/v2/put/sub/make.hpp (contents, props changed)
   sandbox/statistics/support/boost/assign/v2/put/sub/sub.hpp (contents, props changed)

Added: sandbox/statistics/support/boost/assign/v2/put/sub/csv.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/assign/v2/put/sub/csv.hpp 2010-11-12 11:36:09 EST (Fri, 12 Nov 2010)
@@ -0,0 +1,88 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_SUB_CSV_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_SUB_CSV_ER_2010_HPP
+#include <boost/assign/v2/ref/wrapper/framework.hpp>
+#include <boost/assign/v2/ref/wrapper/copy.hpp>
+#include <boost/assign/v2/detail/type_traits/container/value.hpp>
+#include <boost/assign/v2/put/sub/make.hpp>
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace csv_put_aux{
+
+ template<typename V>
+ class sub
+ : protected ref::wrapper<
+ ref::assign_tag::copy,
+ V
+ >
+ {
+
+ protected:
+
+ typedef ref::assign_tag::copy assign_tag_;
+ typedef ref::wrapper<assign_tag_,V> super1_t;
+
+ typedef typename v2::container_type_traits::value<V>::type value_type;
+
+ public:
+
+ sub(){}
+ explicit sub( V& v ) : super1_t( v ) {}
+
+#define MACRO1(z, i, data) ( BOOST_PP_CAT(_, i) )
+#define MACRO2(z, N, data)\
+ typename result_of::put<V>::type\
+ operator()( BOOST_PP_ENUM_PARAMS(N, value_type const & _) )\
+ {\
+ return put( this->unwrap() ) 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
+
+ V& unwrap()const{
+ return static_cast<super1_t const&>(*this).unwrap();
+ }
+
+ };
+
+}// csv_put_aux
+namespace result_of{
+
+ template<typename V>
+ struct csv_put
+ {
+ typedef csv_put_aux::sub<V> type;
+ };
+
+}// result_of
+
+ template<typename V>
+ typename result_of::csv_put<V>::type
+ csv_put( V& v )
+ {
+ typedef typename result_of::csv_put<V>::type result_;
+ return result_( v );
+ }
+
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/support/boost/assign/v2/put/sub/make.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/assign/v2/put/sub/make.hpp 2010-11-12 11:36:09 EST (Fri, 12 Nov 2010)
@@ -0,0 +1,142 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_SUB_MAKE_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_SUB_MAKE_ER_2010_HPP
+#include <boost/assign/v2/ref/wrapper/copy.hpp>
+#include <boost/assign/v2/put/generic/crtp.hpp>
+#include <boost/assign/v2/put/generic/result_of_modulo.hpp>
+
+// Usage:
+// put( v ) % ( _modifier = Tag() );
+// put( v ) % ( _fun = F() );
+// put( v ) % ( _incr_lookup );
+// put( v ) % ( _repeat = n );
+
+namespace boost{
+namespace assign{
+namespace v2{
+namespace put_aux{
+
+ template<typename V,typename F, typename Tag> class sub;
+
+}// put_aux
+namespace result_of_modulo{
+
+ template<typename V,typename F,typename Tag>
+ struct new_fun<put_aux::sub<V,F,Tag> >
+ {
+
+ template<typename F1>
+ struct apply{ typedef put_aux::sub<V,F1,Tag> type; };
+
+ };
+
+ template<typename V,typename F,typename Tag>
+ struct new_modifier<put_aux::sub<V,F,Tag> >
+ {
+
+ template<typename NewTag>
+ struct apply{ typedef put_aux::sub<V,F,NewTag> type; };
+
+ };
+
+}//result_of_modulo
+namespace put_aux{
+
+ template<typename V,typename F, typename Tag> class sub;
+
+ template<typename V,typename F,typename Tag>
+ struct sub_modifier_traits
+ {};
+
+ template<typename V,typename F, typename Tag>
+ class sub
+ : protected ref::wrapper< // must be the first base.
+ ref::assign_tag::copy,
+ V
+ >,
+ public put_aux::crtp<
+ V,
+ F,
+ Tag,
+ sub<V,F,Tag>,
+ sub_modifier_traits<V,F,Tag>
+ >
+ {
+
+ typedef put_aux::crtp<
+ V,
+ F,
+ Tag,
+ sub<V,F,Tag>,
+ sub_modifier_traits<V,F,Tag>
+ > super2_t;
+
+ public:
+
+ typedef typename super2_t::result_type result_type;
+
+ protected:
+
+ typedef put_aux::modifier<Tag> modifier_;
+ typedef ref::assign_tag::copy assign_tag_;
+ typedef ref::wrapper<assign_tag_,V> super1_t;
+
+ public:
+
+ sub(){}
+ explicit sub( V& v ) : super1_t( v ) {}
+ explicit sub( V& v, F const& f )
+ : super1_t( v ), super2_t( f )
+ {
+ // This constructor is required by crtp
+ // when Tag or F is modified.
+ }
+
+ explicit sub( V& v, F const& f, modifier_ const& m )
+ : super1_t( v ), super2_t( f, m )
+ {
+ // This constructor is required by crtp
+ // when Tag or F is modified.
+ }
+
+ V& unwrap()const{
+ return static_cast<super1_t const&>(*this).unwrap();
+ }
+
+ };
+
+}// put_aux
+namespace result_of{
+
+ template<typename V>
+ struct put
+ {
+ typedef put_aux::crtp_traits<V> traits_;
+ typedef typename traits_::functor_type f_;
+ typedef typename traits_::modifier_tag modifier_tag_;
+ typedef put_aux::sub<V,f_,modifier_tag_> type;
+ };
+
+}// result_of
+
+ template<typename V>
+ typename result_of::put<V>::type
+ put( V& v )
+ {
+ typedef typename result_of::put<V>::type result_;
+ return result_( v );
+ }
+
+}// v2
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/support/boost/assign/v2/put/sub/sub.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/support/boost/assign/v2/put/sub/sub.hpp 2010-11-12 11:36:09 EST (Fri, 12 Nov 2010)
@@ -0,0 +1,8 @@
+#ifndef BOOST_ASSIGN_V2_PUT_SUB_SUB_ER_2010_HPP
+#define BOOST_ASSIGN_V2_PUT_SUB_SUB_ER_2010_HPP
+
+#include <boost/assign/v2/put/sub/make.hpp>
+#include <boost/assign/v2/put/sub/csv.hpp>
+
+#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