|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60607 - sandbox/statistics/detail/assign/boost/assign/auto_size/chain
From: erwann.rogard_at_[hidden]
Date: 2010-03-15 00:35:35
Author: e_r
Date: 2010-03-15 00:35:32 EDT (Mon, 15 Mar 2010)
New Revision: 60607
URL: http://svn.boost.org/trac/boost/changeset/60607
Log:
m
Text files modified:
sandbox/statistics/detail/assign/boost/assign/auto_size/chain/chain_convert.hpp | 6 ++++--
sandbox/statistics/detail/assign/boost/assign/auto_size/chain/converter.hpp | 27 ++++++++++++++++++++++++++-
2 files changed, 30 insertions(+), 3 deletions(-)
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/chain/chain_convert.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/chain/chain_convert.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/chain/chain_convert.hpp 2010-03-15 00:35:32 EDT (Mon, 15 Mar 2010)
@@ -65,13 +65,14 @@
template<typename F,typename R2>
struct result<F(const R2&)> : result_impl<R2,true>{};
- chain_convert(const R1 & r) : super_(r),copy(r){ }
+ chain_convert(const R1 & r) : super_(r){}
template<typename R2>
typename result_impl<R2,false>::type
operator()(R2 & r2)const
{
typedef typename result_impl<R2,false>::type result_;
+ this->copy = (*this); // guarantees synchronized
return result_(chain_convert_impl<Conv>(this->copy,r2));
}
@@ -80,11 +81,12 @@
operator()(const R2 & r2)const
{
typedef typename result_impl<R2,true>::type result_;
+ this->copy = (*this); // guarantees synchronized
return result_(chain_convert_impl<Conv>(this->copy,r2));
}
private:
- mutable boost::sub_range<R1> copy;
+ mutable super_ copy;
};
}// adaptor
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/chain/converter.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/chain/converter.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/chain/converter.hpp 2010-03-15 00:35:32 EDT (Mon, 15 Mar 2010)
@@ -17,6 +17,9 @@
// Usage:
// convert_range<T>(r)
+// There must be a better way to convert than 'transform'. An iterator adaptor
+// that alters the reference type should suffice.
+
namespace boost{
namespace assign{
namespace detail{
@@ -47,7 +50,29 @@
{
typedef adaptor::convert<T> adaptor_;
typedef boost::transform_range<adaptor_,Rng> type;
-
+
+/*
+template<typename I,typename T>
+class iterator_converter : boost::iterator_adaptor<
+ iterator_converter<I,T>,
+ I,
+ use_default,
+ typename boost::remove_reference<T>::type,
+ T,
+ use_default
+>{
+ typedef boost::iterator_adaptor<
+ iterator_converter<I,T>,
+ I,
+ use_default,
+ typename boost::remove_reference<T>::type,
+ T,
+ use_default
+ > super_;
+
+ iterator_converter(const I& base):super_(base){}
+};
+*/
static void internal_check(){
BOOST_MPL_ASSERT((boost::is_convertible<U,T>));
typedef typename boost::range_reference<type>::type new_ref_;
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