Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60836 - sandbox/statistics/detail/assign/boost/assign/auto_size/range
From: erwann.rogard_at_[hidden]
Date: 2010-03-25 22:07:44


Author: e_r
Date: 2010-03-25 22:07:43 EDT (Thu, 25 Mar 2010)
New Revision: 60836
URL: http://svn.boost.org/trac/boost/changeset/60836

Log:
m
Added:
   sandbox/statistics/detail/assign/boost/assign/auto_size/range/basic_chain.hpp
      - copied, changed from r60835, /sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain.hpp
Removed:
   sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain.hpp
Text files modified:
   sandbox/statistics/detail/assign/boost/assign/auto_size/range/basic_chain.hpp | 50 +++++++++++++++------------------------
   sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain_convert.hpp | 12 ++++----
   sandbox/statistics/detail/assign/boost/assign/auto_size/range/result_of_chain.hpp | 4 +-
   3 files changed, 27 insertions(+), 39 deletions(-)

Copied: sandbox/statistics/detail/assign/boost/assign/auto_size/range/basic_chain.hpp (from r60835, /sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain.hpp)
==============================================================================
--- /sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/range/basic_chain.hpp 2010-03-25 22:07:43 EDT (Thu, 25 Mar 2010)
@@ -1,5 +1,5 @@
 //////////////////////////////////////////////////////////////////////////////
-// assign::detail::range::chain_l.hpp //
+// assign::detail::basic_chain_impl.hpp //
 // //
 // (C) Copyright 2010 Erwann Rogard //
 // Use, modification and distribution are subject to the //
@@ -16,20 +16,21 @@
 #include <boost/utility/enable_if.hpp>
 #include <boost/range/chain.hpp>
 #include <boost/assign/auto_size/range/result_of_chain.hpp>
+#include <boost/assign/auto_size/range/hold_previous.hpp>
 
 // This is based on
 // http://gist.github.com/287791
 // developed by MPG, but allows lvalues.
 
 // Usage : Let r1, r2 and r3 denote lvalues of ranges,
-// boost::copy( input, boost::begin( chain_l(r1)(r2)(r3) ) );
-// Note: if either of r, r2 or r3 is a range of reference wrappers, then all
-// three also have to.
+// boost::copy( input, boost::begin( basic_chain_l(r1)(r2)(r3) ) );
+// Note: r1, r2, r3 cannot be a mixture of ranges of values and ranges of
+// reference wrappers, hence the prefix 'basic'.
 
 namespace boost{
-namespace range{
+namespace assign{
 namespace detail{
-namespace chain_impl{
+namespace basic_chain_impl{
 
     template<typename E,typename R1,bool is_first,bool add_const> class expr;
 
@@ -56,31 +57,18 @@
         typedef boost::sub_range<sel_r1_> type;
     };
                       
- 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;
- };
-
     template<typename E,bool is_first,bool add_const>
     struct sel_hold_previous : boost::mpl::if_c<
         add_const,
         boost::mpl::empty_base,
- hold_previous<E,is_first>
+ assign::detail::hold_previous<E,is_first>
>{};
 
                       
     template<typename E,typename R1,bool is_first,bool add_const>
         class expr :
         sel_hold_previous<E,is_first,add_const>::type,
- public chain_impl::facade_of_expr<E,R1,is_first,add_const>::type
+ public basic_chain_impl::facade_of_expr<E,R1,is_first,add_const>::type
     {
         protected:
         typedef expr<E,R1,is_first,add_const> this_;
@@ -97,7 +85,7 @@
         public:
 
         typedef typename
- chain_impl::facade_of_expr<E,R1,is_first,add_const>::type facade_;
+ basic_chain_impl::facade_of_expr<E,R1,is_first,add_const>::type facade_;
                     
         facade_& facade(){ return (*this); }
         const facade_& facade()const{ return (*this); }
@@ -117,7 +105,7 @@
 
         // unary operators
         template<typename R2>
- struct result_impl : chain_impl::next_expr<this_,R2,add_const>{};
+ struct result_impl : basic_chain_impl::next_expr<this_,R2,add_const>{};
 
         template<typename R2>
         typename result_impl<R2>::type
@@ -140,26 +128,26 @@
     template<typename R1,bool add_const>
     struct first_expr{
         typedef boost::mpl::void_ top_;
- typedef chain_impl::expr<top_,R1,true,add_const> type;
+ typedef basic_chain_impl::expr<top_,R1,true,add_const> type;
         typedef typename sel_const<R1,add_const>::type sel_r1_;
         static type call(sel_r1_& r1){ return type(r1); }
     };
 
     
-}// chain_impl
+}// basic_chain_impl
 }// detail
 
     template<typename R1>
- typename detail::chain_impl::first_expr<R1,false>::type
- chain_l(R1& r1){
- typedef detail::chain_impl::first_expr<R1,false> caller_;
+ typename detail::basic_chain_impl::first_expr<R1,false>::type
+ basic_chain_l(R1& r1){
+ typedef detail::basic_chain_impl::first_expr<R1,false> caller_;
         return caller_::call(r1);
     }
 
     template<typename R1>
- typename detail::chain_impl::first_expr<R1,true>::type
- chain_r(const R1& r1){
- typedef detail::chain_impl::first_expr<R1,true> caller_;
+ typename detail::basic_chain_impl::first_expr<R1,true>::type
+ basic_chain_r(const R1& r1){
+ typedef detail::basic_chain_impl::first_expr<R1,true> caller_;
         return caller_::call(r1);
     }
 

Deleted: sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain.hpp 2010-03-25 22:07:43 EDT (Thu, 25 Mar 2010)
+++ (empty file)
@@ -1,169 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-// 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_CHAIN_L_ER_2010_HPP
-#define BOOST_ASSIGN_DETAIL_RANGE_CHAIN_L_ER_2010_HPP
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/void.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/type_traits/add_const.hpp>
-#include <boost/type_traits/is_const.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/range/chain.hpp>
-#include <boost/assign/auto_size/range/result_of_chain.hpp>
-
-// This is based on
-// http://gist.github.com/287791
-// developed by MPG, but allows lvalues.
-
-// Usage : Let r1, r2 and r3 denote lvalues of ranges,
-// boost::copy( input, boost::begin( chain_l(r1)(r2)(r3) ) );
-// Note: if either of r, r2 or r3 is a range of reference wrappers, then all
-// three also have to.
-
-namespace boost{
-namespace range{
-namespace detail{
-namespace chain_impl{
-
- template<typename E,typename R1,bool is_first,bool add_const> class expr;
-
- template<typename E,typename R2,bool add_const>
- struct next_expr{
- typedef expr<E,R2,false,add_const> type;
- };
-
- template<typename T,bool b>
- struct sel_const
- : boost::mpl::if_c<b,typename boost::add_const<T>::type,T>{};
-
- template<typename E,typename R1,bool is_first,bool add_const>
- struct facade_of_expr{
- typedef typename E::facade_ facade_;
- typedef typename sel_const<facade_,add_const>::type sel_facade_;
- typedef typename sel_const<R1,add_const>::type sel_r1_;
- typedef typename result_of::chain<sel_facade_,sel_r1_>::type type;
- };
-
- template<typename E,typename R1,bool add_const>
- struct facade_of_expr<E,R1,true,add_const>{
- typedef typename sel_const<R1,add_const>::type sel_r1_;
- typedef boost::sub_range<sel_r1_> type;
- };
-
- 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;
- };
-
- template<typename E,bool is_first,bool add_const>
- struct sel_hold_previous : boost::mpl::if_c<
- add_const,
- boost::mpl::empty_base,
- hold_previous<E,is_first>
- >{};
-
-
- template<typename E,typename R1,bool is_first,bool add_const>
- class expr :
- sel_hold_previous<E,is_first,add_const>::type,
- public chain_impl::facade_of_expr<E,R1,is_first,add_const>::type
- {
- protected:
- typedef expr<E,R1,is_first,add_const> this_;
-
- typedef typename sel_hold_previous<E,is_first,add_const>::type
- hold_previous_;
-
- typedef typename sel_const<E,add_const>::type sel_e_;
- typedef typename sel_const<R1,add_const>::type sel_r1_;
-
- template<typename T,bool b> //a dependence on T is needed
- struct enable : boost::enable_if_c<b>{};
-
- public:
-
- typedef typename
- chain_impl::facade_of_expr<E,R1,is_first,add_const>::type facade_;
-
- facade_& facade(){ return (*this); }
- const facade_& facade()const{ return (*this); }
-
- // lvalue constructors
- explicit expr(R1& r1):facade_(r1){}
- explicit expr(E& p, R1& r1)
- :hold_previous_(p),
- facade_(boost::chain(this->previous.facade(),r1))
- { }
-
- // rvalue constructors
- explicit expr(const R1& r1):facade_(r1){}
- explicit expr(const E& p, const R1& r1)
- :facade_(boost::chain(p.facade(),r1))
- { }
-
- // unary operators
- template<typename R2>
- struct result_impl : chain_impl::next_expr<this_,R2,add_const>{};
-
- template<typename R2>
- typename result_impl<R2>::type
- operator()(R2& r2,typename enable<R2,!add_const>::type* = 0)
- {
- typedef typename result_impl<R2>::type res_;
- return res_(*this,r2);
- }
-
- template<typename R2>
- typename result_impl<R2>::type
- operator()(const R2& r2,typename enable<R2,add_const>::type* = 0)const
- {
- typedef typename result_impl<R2>::type res_;
- return res_(*this,r2);
- }
-
- };
-
- template<typename R1,bool add_const>
- struct first_expr{
- typedef boost::mpl::void_ top_;
- typedef chain_impl::expr<top_,R1,true,add_const> type;
- typedef typename sel_const<R1,add_const>::type sel_r1_;
- static type call(sel_r1_& r1){ return type(r1); }
- };
-
-
-}// chain_impl
-}// detail
-
- template<typename R1>
- typename detail::chain_impl::first_expr<R1,false>::type
- chain_l(R1& r1){
- typedef detail::chain_impl::first_expr<R1,false> caller_;
- return caller_::call(r1);
- }
-
- template<typename R1>
- typename detail::chain_impl::first_expr<R1,true>::type
- chain_r(const R1& r1){
- typedef detail::chain_impl::first_expr<R1,true> caller_;
- return caller_::call(r1);
- }
-
-}// range
-}// boost
-
-#endif
\ No newline at end of file

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain_convert.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain_convert.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/range/chain_convert.hpp 2010-03-25 22:07:43 EDT (Thu, 25 Mar 2010)
@@ -40,7 +40,7 @@
     // ---- template parameters ---- //
 
     // L : converted_range::list<> or empty base if rvalue
- // E : range::detail::chain_impl::expr<>
+ // E : basic_chain_impl::expr<>
     // Rng1 : a range to chain to
     // is_first : indicator
     // V : a value conversion parameter
@@ -58,7 +58,7 @@
         bool is_first,typename V,typename R,bool add_const>
     struct impl_of_expr
     {
- typedef typename range::detail::chain_impl::sel_const<Rng1,add_const>::type cr1_;
+ typedef typename basic_chain_impl::sel_const<Rng1,add_const>::type cr1_;
         typedef typename
             detail::result_of::convert_range<cr1_,V,R>::type conv_r1_;
         typedef typename E::template result_impl<conv_r1_>::type type;
@@ -67,9 +67,9 @@
     template<typename E,typename Rng1,typename V,typename R,bool add_const>
     struct impl_of_expr<E,Rng1,true,V,R,add_const>
     {
- typedef typename range::detail::chain_impl::sel_const<Rng1,add_const>::type cr1_;
+ typedef typename basic_chain_impl::sel_const<Rng1,add_const>::type cr1_;
         typedef typename result_of::convert_range<cr1_,V,R>::type conv_r1_;
- typedef typename range::detail::chain_impl::first_expr<conv_r1_,add_const>::type type;
+ typedef typename basic_chain_impl::first_expr<conv_r1_,add_const>::type type;
     };
 
     typedef boost::mpl::void_ top_;
@@ -173,7 +173,7 @@
     template<typename Rng1,typename V,typename R, bool add_const>
     struct first_expr{
         typedef chain_convert_impl::expr<top_,top_,Rng1,1,V,R,add_const> type;
- typedef typename range::detail::chain_impl::sel_const<Rng1,add_const>::type cr1_;
+ typedef typename basic_chain_impl::sel_const<Rng1,add_const>::type cr1_;
         static type call(cr1_& r1){ return type(r1); }
     };
 
@@ -195,7 +195,7 @@
         typedef typename boost::range_reference<Rng1>::type from_;
         typedef typename reference_traits::convert_to<from_>::type ref_to_;
         typedef typename boost::remove_reference<ref_to_>::type to_;
- typedef typename range::detail::chain_impl::sel_const<to_,add_const>::type type;
+ typedef typename basic_chain_impl::sel_const<to_,add_const>::type type;
     };
 
 }// chain_convert_l_impl

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/range/result_of_chain.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/range/result_of_chain.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/range/result_of_chain.hpp 2010-03-25 22:07:43 EDT (Thu, 25 Mar 2010)
@@ -12,7 +12,7 @@
 #include <boost/range/chain.hpp>
 
 namespace boost{
-namespace range{
+namespace assign{
 namespace detail{
 
 namespace result_of{
@@ -38,7 +38,7 @@
 }
 
 }// detail
-}// range
+}// assign
 }// boost
 
 #endif
\ 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