|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60555 - in sandbox/statistics/detail/assign: boost/assign/auto_size/chain boost/assign/auto_size/check libs/assign/example
From: erwann.rogard_at_[hidden]
Date: 2010-03-13 09:27:42
Author: e_r
Date: 2010-03-13 09:27:41 EST (Sat, 13 Mar 2010)
New Revision: 60555
URL: http://svn.boost.org/trac/boost/changeset/60555
Log:
m
Text files modified:
sandbox/statistics/detail/assign/boost/assign/auto_size/chain/as_member.hpp | 21 +++++----------------
sandbox/statistics/detail/assign/boost/assign/auto_size/chain/auto_convert.hpp | 34 +++++++++++++++++-----------------
sandbox/statistics/detail/assign/boost/assign/auto_size/chain/converter.hpp | 24 ++++++++++++++++++------
sandbox/statistics/detail/assign/boost/assign/auto_size/check/chain.hpp | 2 +-
sandbox/statistics/detail/assign/boost/assign/auto_size/check/ref_list_of.hpp | 5 +++--
sandbox/statistics/detail/assign/libs/assign/example/chain.cpp | 7 ++++---
6 files changed, 48 insertions(+), 45 deletions(-)
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/chain/as_member.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/chain/as_member.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/chain/as_member.hpp 2010-03-13 09:27:41 EST (Sat, 13 Mar 2010)
@@ -8,21 +8,10 @@
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_ASSIGN_AUTO_SIZE_DETAIL_ARRAY_CHAINABLE_ER_2010_HPP
#define BOOST_ASSIGN_AUTO_SIZE_DETAIL_ARRAY_CHAINABLE_ER_2010_HPP
+#include <boost/assign/auto_size/chain/auto_convert.hpp>
namespace boost{
namespace assign{
-
-namespace result_of{
-namespace chain_auto_convert{
- template<typename R1,typename R2>
- struct convert_wrapper;
-}// chain_auto_convert
-}// result_of
-
-template<typename R1,typename R2>
-typename result_of::chain_auto_convert::convert_wrapper<R1,R2>::type
-chain_auto_convert_convert_wrapper(R1& r1,R2& r2);
-
namespace detail{
// D is a derived type
@@ -36,16 +25,16 @@
template<typename R>
typename result_of_chain_auto_convert<D,R>::type
chain_auto_convert(R& r){
- return assign::chain_auto_convert_convert_wrapper(
+ return assign::chain_auto_convert(
static_cast<D&>(*this),
r
);
}
template<typename R>
- typename result_of_chain_auto_convert<const D,R>::type
- chain_auto_convert(R& r)const{
- return assign::chain_auto_convert_convert_wrapper(
+ typename result_of_chain_auto_convert<const D,const R>::type
+ chain_auto_convert(const R& r)const{
+ return assign::chain_auto_convert(
static_cast<const D&>(*this),
r
);
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/chain/auto_convert.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/chain/auto_convert.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/chain/auto_convert.hpp 2010-03-13 09:27:41 EST (Sat, 13 Mar 2010)
@@ -77,32 +77,32 @@
template<typename Conv,typename R1,typename R2>
typename result_of::chain_auto_convert::generic<Conv,R1,R2>::type
chain_auto_convert(R1& r1, R2& r2){
- typedef result_of::chain_auto_convert::generic<Conv,R1,R2> g_;
- return g_::call(r1,r2);
+ typedef result_of::chain_auto_convert::generic<Conv,R1,R2> caller_;
+ return caller_::call(r1,r2);
}
- // ignore_wrapper
- template<typename R1,typename R2>
- typename result_of::chain_auto_convert::ignore_wrapper<R1,R2>::type
- chain_auto_convert_ignore_wrapper(R1& r1,R2& r2){
- typedef result_of::chain_auto_convert::ignore_wrapper<R1,R2> g_;
- return g_::call(r1,r2);
+ template<typename Conv,typename R1,typename R2>
+ typename result_of::chain_auto_convert::generic<Conv,
+ const R1,const R2>::type
+ chain_auto_convert(const R1& r1, const R2& r2){
+ return chain_auto_convert<Conv,const R1,const R2>(r1,r2);
}
- // convert_wrapper
+ // default uses convert_wrapper
template<typename R1,typename R2>
typename result_of::chain_auto_convert::convert_wrapper<R1,R2>::type
- chain_auto_convert_convert_wrapper(R1& r1,R2& r2){
- typedef result_of::chain_auto_convert::convert_wrapper<R1,R2> g_;
- return g_::call(r1,r2);
+ chain_auto_convert(R1& r1,R2& r2){
+ typedef result_of::chain_auto_convert::convert_wrapper<R1,R2> caller_;
+ return caller_::call(r1,r2);
}
- // default
template<typename R1,typename R2>
- typename result_of::chain_auto_convert::convert_wrapper<R1,R2>::type
- chain_auto_convert(R1& r1,R2& r2){
- typedef result_of::chain_auto_convert::convert_wrapper<R1,R2> g_;
- return g_::call(r1,r2);
+ typename result_of::chain_auto_convert::convert_wrapper<
+ const R1,const R2>::type
+ chain_auto_convert(const R1& r1,const R2& r2){
+ typedef result_of::chain_auto_convert::convert_wrapper<
+ const R1,const R2> caller_;
+ return caller_::call(r1,r2);
}
}// assign
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-13 09:27:41 EST (Sat, 13 Mar 2010)
@@ -32,8 +32,8 @@
template<typename U>
T operator()(U& arg)const{ return arg; }
- template<typename U>
- T operator()(const U& arg)const{ return arg; }
+ //template<typename U>
+ //T operator()(const U& arg)const{ return arg; }
};
@@ -50,8 +50,7 @@
static void internal_check(){
BOOST_MPL_ASSERT((boost::is_convertible<U,T>));
- typedef boost::transform_range<adaptor_,Rng> new_range_;
- typedef typename boost::range_reference<new_range_>::type new_ref_;
+ typedef typename boost::range_reference<type>::type new_ref_;
BOOST_MPL_ASSERT((boost::is_same<new_ref_,T>));
}
static type call(Rng& r){
@@ -62,8 +61,6 @@
}
- // Takes care of const Rng, I think.
-
template<typename T,typename Rng>
typename detail::result_of::convert_range<T,Rng>::type
convert_range( Rng& r)
@@ -71,6 +68,13 @@
typedef detail::result_of::convert_range<T,Rng> caller_;
return caller_::call( r );
}
+
+ template<typename T,typename Rng>
+ typename detail::result_of::convert_range<T,const Rng>::type
+ convert_range( const Rng& r)
+ {
+ return convert_range<T,const Rng>(r);
+ }
template<typename T,typename Rng>
inline typename detail::result_of
@@ -80,6 +84,14 @@
return convert_range<T>(r);
}
+ template<typename T,typename Rng>
+ inline typename detail::result_of
+ ::convert_range<T,const Rng>::type
+ operator|( const Rng& r, const detail::functional::converter<T>& f )
+ {
+ return convert_range<T>(r);
+ }
+
}// detail
}// assign
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/check/chain.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/check/chain.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/chain.hpp 2010-03-13 09:27:41 EST (Sat, 13 Mar 2010)
@@ -31,7 +31,7 @@
// TODO const C1.
template<typename C,typename C1,typename T>
- void check_chain(C& coll,C1& coll1,
+ void check_chain(C& coll,const C1& coll1,
T& a, T& b, T& c, T& d, T& e, T& f, T& g, T& h
)
{
Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/check/ref_list_of.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/check/ref_list_of.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/ref_list_of.hpp 2010-03-13 09:27:41 EST (Sat, 13 Mar 2010)
@@ -136,13 +136,14 @@
{
val_ a, b, c, d, e, f, g, h;
BOOST_AUTO(tmp1,ref_list_of(a)(b)(c)(d));
- BOOST_AUTO(tmp2,cref_list_of(e)(f)(g)(h)); // For now (rvalue otherwise)
+ // BOOST_AUTO(tmp2,cref_list_of(e)(f)(g)(h)); // For now (rvalue otherwise)
check_chain(
tmp1,
- tmp2,
+ cref_list_of(e)(f)(g)(h),
a,b,c,d,e,f,g,h);
}
+ // TODO comparison operators
}
Modified: sandbox/statistics/detail/assign/libs/assign/example/chain.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/example/chain.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/example/chain.cpp 2010-03-13 09:27:41 EST (Sat, 13 Mar 2010)
@@ -31,9 +31,10 @@
ar_ ar; ar.assign( -1 );
BOOST_AUTO(tmp1,ref_list_of(a)(b)(c)(d));
BOOST_AUTO(tmp2,cref_list_of(e)(f)(g)(h));
- BOOST_AUTO(tmp3,
- tmp1.chain_auto_convert(tmp2));
+
+ os << *boost::begin(ref_list_of(e)(f)(g)(h).chain_auto_convert(cref_list_of(e)(f)(g)(h))) << std::endl;
//detail::add_const(tmp1).chain_auto_convert(tmp2));
+/*
os << *boost::next(boost::begin(tmp3),0) << std::endl;// EXC_BAD_ACCESS if add_const
os << *boost::next(boost::begin(tmp3),1) << std::endl;
os << *boost::next(boost::begin(tmp3),2) << std::endl;
@@ -42,7 +43,7 @@
os << *boost::next(boost::begin(tmp3),5) << std::endl;
os << *boost::next(boost::begin(tmp3),6) << std::endl;
os << *boost::next(boost::begin(tmp3),7) << std::endl;
-
+*/
os << "<- " << std::endl;
}
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