Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69099 - in sandbox/assign_v2: boost/assign/v2/detail/check boost/assign/v2/detail/check/equal_container libs/assign/v2/test libs/assign/v2/test/put/container libs/assign/v2/test/put/pipe/csv libs/assign/v2/test/put/pipe/functor libs/assign/v2/test/put/ptr libs/assign/v2/test/put/std libs/assign/v2/test/utility
From: erwann.rogard_at_[hidden]
Date: 2011-02-20 14:53:59


Author: e_r
Date: 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
New Revision: 69099
URL: http://svn.boost.org/trac/boost/changeset/69099

Log:
upd assign_v2
Text files modified:
   sandbox/assign_v2/boost/assign/v2/detail/check/equal_container.hpp | 4 +-
   sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/array.hpp | 2
   sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/fifo.hpp | 2
   sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/lifo.hpp | 2
   sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/pp.hpp | 5 +-
   sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/sorted.hpp | 6 +-
   sandbox/assign_v2/libs/assign/v2/test/other.cpp | 32 ++++++++++++++----
   sandbox/assign_v2/libs/assign/v2/test/put/container/csv.cpp | 16 ++++----
   sandbox/assign_v2/libs/assign/v2/test/put/container/functor.cpp | 70 ++++++++++++++++++++--------------------
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/container.cpp | 8 ++--
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/ext.cpp | 10 ++--
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/container.cpp | 32 +++++++++---------
   sandbox/assign_v2/libs/assign/v2/test/put/ptr/functor.cpp | 31 ++++++++---------
   sandbox/assign_v2/libs/assign/v2/test/put/std/functor.cpp | 8 ++--
   sandbox/assign_v2/libs/assign/v2/test/utility/chain.cpp | 23 ++++++------
   sandbox/assign_v2/libs/assign/v2/test/utility/convert.cpp | 32 ++++++++++++++++++
   16 files changed, 167 insertions(+), 116 deletions(-)

Modified: sandbox/assign_v2/boost/assign/v2/detail/check/equal_container.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/detail/check/equal_container.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/detail/check/equal_container.hpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -26,14 +26,14 @@
     void equal_container(C & cont, R const& r)
     {
         typedef typename v2::check_aux::deduce_equal_container_tag<C>::type tag;
- v2::checking::equal( tag(), cont, r );
+ v2::check_aux::equal_container( tag(), cont, r );
     }
 
     template<typename C, typename R>
     void equal_container(C const& cont, R const& r)
     {
         typedef typename v2::check_aux::deduce_equal_container_tag<C>::type tag;
- v2::checking::equal( tag(), cont, r );
+ v2::check_aux::equal_container( tag(), cont, r );
     }
 
 }// check_aux

Modified: sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/array.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/array.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/array.hpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -11,7 +11,7 @@
 #define BOOST_ASSIGN_V2_DETAIL_CHECK_EQUAL_CONTAINER_ARRAY_ER_2010_HPP
 #include <boost/assign/v2/detail/config/check.hpp>
 #include <boost/assign/v2/detail/traits/container/is_array.hpp>
-#include <boost/assign/v2/detail/check_equal_container/pp.hpp>
+#include <boost/assign/v2/detail/check/equal_container/pp.hpp>
 
 namespace boost{
 namespace assign{

Modified: sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/fifo.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/fifo.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/fifo.hpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -11,7 +11,7 @@
 #define BOOST_ASSIGN_V2_DETAIL_CHECK_EQUAL_CONTAINER_FIFO_ER_2010_HPP
 #include <boost/assign/v2/detail/config/check.hpp>
 #include <boost/assign/v2/detail/traits/container/is_fifo.hpp>
-#include <boost/assign/v2/detail/check_equal_container/pp.hpp>
+#include <boost/assign/v2/detail/check/equal_container/pp.hpp>
 
 namespace boost{
 namespace assign{

Modified: sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/lifo.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/lifo.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/lifo.hpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -11,7 +11,7 @@
 #define BOOST_ASSIGN_V2_DETAIL_CHECK_EQUAL_CONTAINER_LIFO_ER_2010_HPP
 #include <boost/assign/v2/detail/config/check.hpp>
 #include <boost/assign/v2/detail/traits/container/is_lifo.hpp>
-#include <boost/assign/v2/detail/check_equal_container/pp.hpp>
+#include <boost/assign/v2/detail/check/equal_container/pp.hpp>
 
 namespace boost{
 namespace assign{

Modified: sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/pp.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/pp.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/pp.hpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -9,13 +9,14 @@
 //////////////////////////////////////////////////////////////////////////////
 #ifndef BOOST_ASSIGN_V2_DETAIL_CHECK_EQUAL_CONTAINER_PP_ER_2010_HPP
 #define BOOST_ASSIGN_V2_DETAIL_CHECK_EQUAL_CONTAINER_PP_ER_2010_HPP
+#include <boost/assign/v2/detail/config/check.hpp>
 
 #include <boost/range/size.hpp>
 #include <boost/range/size_type.hpp>
 #define BOOST_ASSIGN_V2_CHECK_AUX_CONTAINER_SIZE\
- typedef boost::range_size<R>::type size_type;\
+ typedef typename boost::range_size<R>::type size_type;\
         size_type n1 = cont.size();\
- size_type n2 = boost::range_size( r );\
+ size_type n2 = boost::size( r );\
         BOOST_ASSIGN_V2_CHECK( n2 >= n1 );\
 /**/
 

Modified: sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/sorted.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/sorted.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/detail/check/equal_container/sorted.hpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -10,7 +10,7 @@
 #ifndef BOOST_ASSIGN_V2_DETAIL_CHECK_EQUAL_CONTAINER_SORTED_ER_2010_HPP
 #define BOOST_ASSIGN_V2_DETAIL_CHECK_EQUAL_CONTAINER_SORTED_ER_2010_HPP
 #include <boost/range/algorithm/sort.hpp>
-#include <boost/assign/v2/detail/check_equal_container/range.hpp>
+#include <boost/assign/v2/detail/check/equal_container/range.hpp>
 
 namespace boost{
 namespace assign{
@@ -21,9 +21,9 @@
     void equal_container(v2::container_tag::sorted, C const & cont, R const& r)
     {
         typedef v2::container_tag::range tag_;
- // needed in case r is not sorted :
+ // R may not be sorted, but benchmark is.
         C benchmark( boost::begin( r ), boost::end( r ) );
- equal(tag_, cont, benchmark );
+ equal_container(tag_(), cont, benchmark );
     }
 
 }// check_aux

Modified: sandbox/assign_v2/libs/assign/v2/test/other.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/other.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/other.cpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -9,7 +9,10 @@
 //////////////////////////////////////////////////////////////////////////////
 #include <utility>
 #include <vector>
+#include <boost/lambda/lambda.hpp>
 #include <boost/range/algorithm/copy.hpp>
+#include <boost/range/algorithm/stable_partition.hpp>
+#include <boost/range/algorithm/equal.hpp>
 #include <boost/assign/v2/detail/config/check.hpp>
 #include <boost/assign/v2/utility/chain.hpp>
 #include <boost/assign/v2/ref/wrapper/adaptor_get.hpp>
@@ -17,6 +20,7 @@
 #include <boost/assign/v2/ref/array/functor.hpp>
 #include <boost/assign/v2/ref/array/functor/converter.hpp>
 #include <boost/assign/v2/put/deque/csv.hpp>
+#include <boost/assign/v2/put/pipe/csv.hpp>
 #include <libs/assign/v2/test/other.h>
 
 namespace test_assign_v2{
@@ -27,6 +31,7 @@
     void test(){
 
         namespace as2 = boost::assign::v2;
+ namespace bl = boost::lambda;
 
         {
             //[array_converter
@@ -45,20 +50,20 @@
         }
         {
             //[chain_w
- std::vector<int> v( 3 ); v[0] = -1; v[1] = 0; v[2] = 1;
- boost::array<int, 2> ar; int z; // lvalues
+ std::vector<int> r( 3 ); r[0] = 1; r[1] = 2; r[2] = 0;
+ boost::array<int, 2> cont; int z; // lvalues
             boost::copy(
- v,
+ r,
                 boost::begin(
- ar | as2::_chain(
+ cont | as2::_chain(
                         as2::ref::csv_array( z ) // rvalue!
                             | as2::ref::_get
                     )
                 )
             );
- BOOST_ASSIGN_V2_CHECK( ar[0] == -1 );
- BOOST_ASSIGN_V2_CHECK( ar[1] == 0 );
- BOOST_ASSIGN_V2_CHECK( z == 1 );
+ BOOST_ASSIGN_V2_CHECK( cont[0] == r[0] );
+ BOOST_ASSIGN_V2_CHECK( cont[1] == r[1] );
+ BOOST_ASSIGN_V2_CHECK( z == r[2] );
             //]
         }
         {
@@ -76,6 +81,19 @@
             BOOST_ASSIGN_V2_CHECK( cont[2].first == "mar" );
             BOOST_ASSIGN_V2_CHECK( cont[2].second == 31 );
         }
+ {
+ // suggested by JB:
+ typedef int T; std::vector<T> cont;
+ boost::range::stable_partition(
+ cont | as2::_csv_put(0, 1, 2, 3, 4, 5),
+ bl::_1 % 2
+ );
+ BOOST_ASSIGN_V2_CHECK(boost::range::equal(
+ cont,
+ as2::ref::csv_array(1, 3, 5, 0, 2, 4)
+ ));
+
+ }
     }
 
 }// xxx_other

Modified: sandbox/assign_v2/libs/assign/v2/test/put/container/csv.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/container/csv.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/container/csv.cpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -26,10 +26,10 @@
             {
                 //[csv_list
                 typedef int T; T x = 1, y = 2, z = 0;
- std::list<T> seq1, seq2;
- ( as2::put( seq1 ) )( x )( y )( z );
- ( as2::csv_put( seq2 ) )( x, y, z );
- BOOST_ASSIGN_V2_CHECK( seq1 == seq2 );
+ std::list<T> cont1, cont2;
+ ( as2::put( cont1 ) )( x )( y )( z );
+ ( as2::csv_put( cont2 ) )( x, y, z );
+ BOOST_ASSIGN_V2_CHECK( cont1 == cont2 );
                 //]
             }
             {
@@ -47,10 +47,10 @@
             {
                 //[ptr_vector
                 typedef int T; T x = 1, y = 2, z = 0;
- boost::ptr_vector<T> seq1, seq2;
- as2::csv_put( seq1 )( x, y, z );
- as2::put( seq2 )( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( seq1 == seq2 );
+ boost::ptr_vector<T> cont1, cont2;
+ as2::csv_put( cont1 )( x, y, z );
+ as2::put( cont2 )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont1 == cont2 );
                 //]
             }
             // TODO ptr_map

Modified: sandbox/assign_v2/libs/assign/v2/test/put/container/functor.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/container/functor.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/container/functor.cpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -32,9 +32,9 @@
         {
             //[array
             typedef int T; T x = 1, y = 2, z = 3;
- boost::array<T, 3> ar; as2::put( ar )( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( ar[0] == x );
- BOOST_ASSIGN_V2_CHECK( ar[2] == z );
+ boost::array<T, 3> cont; as2::put( cont )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont[0] == x );
+ BOOST_ASSIGN_V2_CHECK( cont[2] == z );
             //]
         }
         {
@@ -59,28 +59,28 @@
         {
             //[deque
             typedef int T; T x = 1, y = 2, z = 0;
- std::deque<T> seq;
- as2::put( seq )( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( seq.front() == x );
- BOOST_ASSIGN_V2_CHECK( seq.back() == z );
+ std::deque<T> cont;
+ as2::put( cont )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
             //]
         }
         {
             //[list
             typedef int T; T x = 1, y = 2, z = 0;
- std::list<T> seq;
- ( as2::put( seq ) )( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( seq.front() == x );
- BOOST_ASSIGN_V2_CHECK( seq.back() == z );
+ std::list<T> cont;
+ ( as2::put( cont ) )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
             //]
         }
         {
             //[vector
             typedef int T; T x = 1, y = 2, z = 0;
- std::vector<T> seq;
- as2::put( seq )( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( seq.front() == x );
- BOOST_ASSIGN_V2_CHECK( seq.back() == z );
+ std::vector<T> cont;
+ as2::put( cont )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
             //]
         }
         {
@@ -107,23 +107,23 @@
             //[tuple
             typedef int& ref_; typedef std::string val_;
             typedef boost::tuple<ref_, val_> T;
- int x = 31, y = 28, z = 31; std::vector<T> seq;
- as2::put( seq )( x, "jan" )( y, "feb" )( z, "mar" );
- BOOST_ASSIGN_V2_CHECK( &get<0>( seq[1] ) == &y );
- BOOST_ASSIGN_V2_CHECK( get<1>( seq[1] ) == "feb" );
- //]
- BOOST_ASSIGN_V2_CHECK( &get<0>( seq[0] ) == &x );
- BOOST_ASSIGN_V2_CHECK( get<1>( seq[0] ) == "jan" );
- BOOST_ASSIGN_V2_CHECK( &get<0>( seq[2] ) == &z );
- BOOST_ASSIGN_V2_CHECK( get<1>( seq[2] ) == "mar" );
+ int x = 31, y = 28, z = 31; std::vector<T> cont;
+ as2::put( cont )( x, "jan" )( y, "feb" )( z, "mar" );
+ BOOST_ASSIGN_V2_CHECK( &get<0>( cont[1] ) == &y );
+ BOOST_ASSIGN_V2_CHECK( get<1>( cont[1] ) == "feb" );
+ //]
+ BOOST_ASSIGN_V2_CHECK( &get<0>( cont[0] ) == &x );
+ BOOST_ASSIGN_V2_CHECK( get<1>( cont[0] ) == "jan" );
+ BOOST_ASSIGN_V2_CHECK( &get<0>( cont[2] ) == &z );
+ BOOST_ASSIGN_V2_CHECK( get<1>( cont[2] ) == "mar" );
         }
         {
             //[default_constr1
             typedef int T; T x = 1, z = 0;
- std::vector<T> seq; as2::put( seq )( x )()( z );
- BOOST_ASSIGN_V2_CHECK( seq[0] == x );
- BOOST_ASSIGN_V2_CHECK( seq[1] == T() );
- BOOST_ASSIGN_V2_CHECK( seq[2] == z );
+ std::vector<T> cont; as2::put( cont )( x )()( z );
+ BOOST_ASSIGN_V2_CHECK( cont[0] == x );
+ BOOST_ASSIGN_V2_CHECK( cont[1] == T() );
+ BOOST_ASSIGN_V2_CHECK( cont[2] == z );
             //]
         }
         {
@@ -133,13 +133,13 @@
             typedef boost::tuple<a_, b_> T;
             a_ a0 = "jan", a1 = "feb", a2 = "mar";
             b_ b0 = 31; //, b1 = 28, b2 = 31;
- std::vector<T> seq; as2::put( seq )( a0, b0 )()( a2 );
- BOOST_ASSIGN_V2_CHECK( get<0>( seq[0] ) == a0 );
- BOOST_ASSIGN_V2_CHECK( get<1>( seq[0] ) == b0 );
- BOOST_ASSIGN_V2_CHECK( get<0>( seq[1] ) == get<0>( T() ) );
- BOOST_ASSIGN_V2_CHECK( get<1>( seq[1] ) == get<1>( T() ) );
- BOOST_ASSIGN_V2_CHECK( get<0>( seq[2] ) == a2 );
- BOOST_ASSIGN_V2_CHECK( get<1>( seq[2] ) == b_() );
+ std::vector<T> cont; as2::put( cont )( a0, b0 )()( a2 );
+ BOOST_ASSIGN_V2_CHECK( get<0>( cont[0] ) == a0 );
+ BOOST_ASSIGN_V2_CHECK( get<1>( cont[0] ) == b0 );
+ BOOST_ASSIGN_V2_CHECK( get<0>( cont[1] ) == get<0>( T() ) );
+ BOOST_ASSIGN_V2_CHECK( get<1>( cont[1] ) == get<1>( T() ) );
+ BOOST_ASSIGN_V2_CHECK( get<0>( cont[2] ) == a2 );
+ BOOST_ASSIGN_V2_CHECK( get<1>( cont[2] ) == b_() );
             //]
         }
     }// test()

Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/container.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/container.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/container.cpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -23,10 +23,10 @@
         namespace as2 = boost::assign::v2;
         //[csv_pipe_list
         typedef int T; T x = 1, y = 2, z = 0;
- std::list<T> seq;
- seq | as2::_csv_put( x, y, z );
- BOOST_ASSIGN_V2_CHECK( seq.front() == x );
- BOOST_ASSIGN_V2_CHECK( seq.back() == z );
+ std::list<T> cont;
+ cont | as2::_csv_put( x, y, z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
         //]
     }
 

Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/ext.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/ext.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv/ext.cpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -60,11 +60,11 @@
         {
             //[csv_iterate
             typedef int T; T x = 1, y = 2, z = 0;
- boost::array<T, 3> ar; ar[0] = x;
- ar | (as2::_csv_put % ( as2::_iterate = 1 ) )( y, z );
- BOOST_ASSIGN_V2_CHECK( ar[0] == x );
- BOOST_ASSIGN_V2_CHECK( ar[1] == y );
- BOOST_ASSIGN_V2_CHECK( ar[2] == z );
+ boost::array<T, 3> cont; cont[0] = x;
+ cont | (as2::_csv_put % ( as2::_iterate = 1 ) )( y, z );
+ BOOST_ASSIGN_V2_CHECK( cont[0] == x );
+ BOOST_ASSIGN_V2_CHECK( cont[1] == y );
+ BOOST_ASSIGN_V2_CHECK( cont[2] == z );
             //]
         }
     }

Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/container.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/container.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/container.cpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -33,10 +33,10 @@
             //[pipe_array
             typedef int T;
             T x = 1, y = 2, z = 3;
- boost::array<T, 3> ar;
- ar | as2::_put( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( ar[0] == x );
- BOOST_ASSIGN_V2_CHECK( ar[2] == z );
+ boost::array<T, 3> cont;
+ cont | as2::_put( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont[0] == x );
+ BOOST_ASSIGN_V2_CHECK( cont[2] == z );
             //]
         }
         {
@@ -59,28 +59,28 @@
         {
             //[pipe_deque
             typedef int T; T x = 1, y = 2, z = 0;
- std::deque<T> seq;
- seq | as2::_put( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( seq.front() == x );
- BOOST_ASSIGN_V2_CHECK( seq.back() == z );
+ std::deque<T> cont;
+ cont | as2::_put( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
             //]
         }
         {
             //[pipe_list
             typedef int T; T x = 1, y = 2, z = 0;
- std::list<T> seq;
- seq | as2::_put( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( seq.front() == x );
- BOOST_ASSIGN_V2_CHECK( seq.back() == z );
+ std::list<T> cont;
+ cont | as2::_put( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
             //]
         }
         {
             //[pipe_vector
             typedef int T; T x = 1, y = 2, z = 0;
- std::vector<T> seq;
- seq | as2::_put( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( seq.front() == x );
- BOOST_ASSIGN_V2_CHECK( seq.back() == z );
+ std::vector<T> cont;
+ cont | as2::_put( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
             //]
         }
         {

Modified: sandbox/assign_v2/libs/assign/v2/test/put/ptr/functor.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/ptr/functor.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/ptr/functor.cpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -30,10 +30,9 @@
             //[array
             typedef int T;
             T x = 1, y = 2, z = 3;
- boost::ptr_array<T, 3> ar;
- as2::put( ar )( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( ar[0] == x );
- BOOST_ASSIGN_V2_CHECK( ar[2] == z );
+ boost::ptr_array<T, 3> cont; as2::put( cont )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont[0] == x );
+ BOOST_ASSIGN_V2_CHECK( cont[2] == z );
             //]
         }
 /*
@@ -58,28 +57,28 @@
         {
             //[deque
             typedef int T; T x = 1, y = 2, z = 0;
- boost::ptr_deque<T> seq;
- as2::put( seq )( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( seq.front() == x );
- BOOST_ASSIGN_V2_CHECK( seq.back() == z );
+ boost::ptr_deque<T> cont;
+ as2::put( cont )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
             //]
         }
         {
             //[list
             typedef int T; T x = 1, y = 2, z = 0;
- boost::ptr_list<T> seq;
- ( as2::put( seq ) )( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( seq.front() == x );
- BOOST_ASSIGN_V2_CHECK( seq.back() == z );
+ boost::ptr_list<T> cont;
+ ( as2::put( cont ) )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
             //]
         }
         {
             //[vector
             typedef int T; T x = 1, y = 2, z = 0;
- boost::ptr_vector<T> seq;
- as2::put( seq )( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( seq.front() == x );
- BOOST_ASSIGN_V2_CHECK( seq.back() == z );
+ boost::ptr_vector<T> cont;
+ as2::put( cont )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
             //]
         }
     }// test

Modified: sandbox/assign_v2/libs/assign/v2/test/put/std/functor.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/std/functor.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/std/functor.cpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -28,10 +28,10 @@
         {
             //[std_deque
             typedef int T; T x = 0, y = 2, z = 1;
- std::deque<T> seq;
- ( as2::put( seq ) % as2::_push_front )( x )( y )( z );
- BOOST_ASSIGN_V2_CHECK( seq[0] == z );
- BOOST_ASSIGN_V2_CHECK( seq[2] == x );
+ std::deque<T> cont;
+ ( as2::put( cont ) % as2::_push_front )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont[0] == z );
+ BOOST_ASSIGN_V2_CHECK( cont[2] == x );
             //]
         }
     }

Modified: sandbox/assign_v2/libs/assign/v2/test/utility/chain.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/utility/chain.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/utility/chain.cpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -35,25 +35,26 @@
         {
             //[chain_r
             typedef int T;
- boost::array<T, 2> ar; ar[0] = 0; ar[1] = 1;
+ boost::array<T, 2> cont; cont[0] = 0; cont[1] = 1;
             std::list<T> list; list.push_back( 2 ); list.push_back( 3 );
- std::vector<T> v( boost::begin( ar ), boost::end( ar ) );
+ std::vector<T> v( boost::begin( cont ), boost::end( cont ) );
             boost::copy( list, std::back_inserter( v ) );
             BOOST_ASSIGN_V2_CHECK(
- boost::range::equal( v, ar | as2::_chain( list ) )
+ boost::range::equal( v, cont | as2::_chain( list ) )
             );
             //]
         }
         {
             //[chain_w
- typedef int T; std::vector<T> v( 4 );
- v[0] = 1; v[1] = 2; v[2] = 0; v[3] = 5;
- boost::array<T, 2> ar; std::list<T> list( v.size() - ar.size() );
- boost::copy( v, boost::begin( ar | as2::_chain( list ) ) );
- BOOST_ASSIGN_V2_CHECK( ar[0] == v[0] );
- BOOST_ASSIGN_V2_CHECK( ar[1] == v[1] );
- BOOST_ASSIGN_V2_CHECK( list.front() == v[2] );
- BOOST_ASSIGN_V2_CHECK( list.back() == v[3] );
+ typedef int T; std::vector<T> r( 4 );
+ r[0] = 1; r[1] = 2; r[2] = 0; r[3] = 5;
+ boost::array<T, 2> cont1;
+ std::list<T> cont2( r.size() - cont1.size() );
+ boost::copy( r, boost::begin( cont1 | as2::_chain( cont2 ) ) );
+ BOOST_ASSIGN_V2_CHECK( cont1[0] == r[0] );
+ BOOST_ASSIGN_V2_CHECK( cont1[1] == r[1] );
+ BOOST_ASSIGN_V2_CHECK( cont2.front() == r[2] );
+ BOOST_ASSIGN_V2_CHECK( cont2.back() == r[3] );
             //]
         }
 

Modified: sandbox/assign_v2/libs/assign/v2/test/utility/convert.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/utility/convert.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/utility/convert.cpp 2011-02-20 14:53:54 EST (Sun, 20 Feb 2011)
@@ -10,15 +10,24 @@
 #include <vector>
 #include <stack>
 #include <boost/array.hpp>
+#include <boost/assign/v2/detail/check/equal_container.hpp>
 #include <boost/assign/v2/detail/config/check.hpp>
 #include <boost/assign/v2/utility/convert.hpp>
 #include <boost/assign/v2/utility/convert/check.hpp>
 #include <libs/assign/v2/test/utility/convert.h>
 
+
 namespace test_assign_v2{
 namespace xxx_utility{
 namespace xxx_convert{
 
+ // suggested by JB:
+ template<typename C, typename R>
+ void f(C cont, R const& r){
+ namespace as2 = boost::assign::v2;
+ as2::check_aux::equal_container( cont, r );
+ }
+
     void test()
     {
         namespace as2 = boost::assign::v2;
@@ -50,6 +59,29 @@
             BOOST_ASSIGN_V2_CHECK( lifo.top() == 1 );
             //]
         }
+ {
+ typedef int T;
+ typedef std::vector<int> R; R r( 3 ); r[0] = 1; r[1] = 2; r[2] = 0;
+
+ // TODO figure out why
+ // C(as2::converter( ar ) ); // Call of overloaded C() ambig
+
+ {
+ typedef std::vector<T> C; f<C>( as2::converter( r ), r );
+ }
+ {
+ typedef std::deque<T> C; f<C>( as2::converter( r ), r );
+ }
+ {
+ typedef std::list<T> C; f<C>( as2::converter( r ), r );
+ }
+ {
+ typedef std::stack<T> C; f<C>( as2::converter( r ), r );
+ }
+ {
+ typedef std::queue<T> C; f<C>( as2::converter( r ), r );
+ }
+ }
     }
 
 }// xxx_convert


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