|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60799 - in sandbox/statistics/detail/assign: boost/assign/auto_size/range libs/assign/example
From: erwann.rogard_at_[hidden]
Date: 2010-03-24 00:26:18
Author: e_r
Date: 2010-03-24 00:26:17 EDT (Wed, 24 Mar 2010)
New Revision: 60799
URL: http://svn.boost.org/trac/boost/changeset/60799
Log:
m
Added:
sandbox/statistics/detail/assign/boost/assign/auto_size/range/hold_converted_range.hpp (contents, props changed)
sandbox/statistics/detail/assign/boost/assign/auto_size/range/hold_previous.hpp (contents, props changed)
Text files modified:
sandbox/statistics/detail/assign/libs/assign/example/range.cpp | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
Added: sandbox/statistics/detail/assign/boost/assign/auto_size/range/hold_converted_range.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/range/hold_converted_range.hpp 2010-03-24 00:26:17 EDT (Wed, 24 Mar 2010)
@@ -0,0 +1,71 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::range::chain_l.hpp //
+// //
+// (C) Copyright 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_DETAIL_RANGE_HOLD_CONVERTED_RANGE_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_RANGE_HOLD_CONVERTED_RANGE_ER_2010_HPP
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/void.hpp>
+#include <boost/assign/auto_size/range/convert_range.hpp>
+#include <boost/assign/auto_size/range/hold_previous.hpp>
+
+namespace boost{
+namespace assign{
+namespace detail{
+
+namespace converted_range{
+
+ template<typename Rng,typename V,typename R> // bool is_first
+ class holder{
+ typedef typename
+ detail::result_of::convert_range<Rng,V,R>::type storage_;
+
+ public:
+
+ holder(){}
+ holder(Rng& r):converted_range(convert_range<V,R>(r)){}
+
+ mutable storage_ converted_range;
+ };
+
+ template<typename E,typename Rng1,bool is_first,typename V,typename R>
+ class list
+ : public hold_previous<E,is_first>,
+ public holder<Rng1,V,R>
+ {
+ typedef list<E,Rng1,is_first,V,R> this_;
+ typedef hold_previous<E,is_first> previous_;
+ typedef converted_range::holder<Rng1,V,R> holder_;
+
+ public:
+
+ typedef V conversion_value;
+ typedef R conversion_reference;
+
+ list(Rng1& r1):holder_(r1){}
+ list(E& e,Rng1& r1)
+ :previous_(e),holder_(r1){}
+
+ template<typename Rng2>
+ struct result_of_next{ typedef list<this_,Rng2,is_first,V,R> type; };
+
+ template<typename Rng2>
+ typename result_of_next<Rng2>::type
+ next(Rng2& r2){
+ typedef typename result_of_next<Rng2>::type res_;
+ return res_(*this,r2);
+ }
+
+ };
+
+
+}// converted_range
+}// detail
+}// assign
+}// boost
+
+#endif
Added: sandbox/statistics/detail/assign/boost/assign/auto_size/range/hold_previous.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/range/hold_previous.hpp 2010-03-24 00:26:17 EDT (Wed, 24 Mar 2010)
@@ -0,0 +1,36 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::range::hold_previous.hpp //
+// //
+// (C) Copyright 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_DETAIL_RANGE_HOLD_PREVIOUS_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_RANGE_HOLD_PREVIOUS_ER_2010_HPP
+#include <boost/mpl/int.hpp>
+#include <boost/mpl/equal_to.hpp>
+#include <boost/mpl/if.hpp>
+
+namespace boost{
+namespace assign{
+namespace detail{
+
+ template<typename E,bool is_first>
+ class hold_previous{
+ typedef typename boost::mpl::if_c<is_first,E,E&>::type previous_;
+
+ public:
+
+ hold_previous(){}
+ hold_previous(E& p)
+ :previous(p){}
+
+ mutable previous_ previous;
+ };
+
+}// detail
+}// assign
+}// boost
+
+#endif
\ No newline at end of file
Modified: sandbox/statistics/detail/assign/libs/assign/example/range.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/example/range.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/example/range.cpp 2010-03-24 00:26:17 EDT (Wed, 24 Mar 2010)
@@ -38,11 +38,6 @@
BOOST_AUTO(tmp2,ref_list_of(c)(d));
BOOST_AUTO(tmp3,ref_list_of(e)(f));
- boost::copy(
- chain_convert_l(ar1)(ar2),
- std::ostream_iterator<int>(os," ")
- );
-
os << " chain_l(tmp1)(tmp2)(tmp3) = (";
boost::copy(
chain_convert_l(tmp1)(ar5)(tmp3),
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