|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r69980 - in sandbox/assign_v2/libs/assign/v2: src test test/put test/put/modifier test/put/pipe test/put/pipe/modifier test/ref test/utility
From: erwann.rogard_at_[hidden]
Date: 2011-03-14 17:02:27
Author: e_r
Date: 2011-03-14 17:02:24 EDT (Mon, 14 Mar 2011)
New Revision: 69980
URL: http://svn.boost.org/trac/boost/changeset/69980
Log:
upd assign_v2
Text files modified:
sandbox/assign_v2/libs/assign/v2/src/main.cpp | 9 +--
sandbox/assign_v2/libs/assign/v2/test/mix.cpp | 18 ------
sandbox/assign_v2/libs/assign/v2/test/put/deque.cpp | 38 ++++++--------
sandbox/assign_v2/libs/assign/v2/test/put/modifier/iterate.cpp | 6 +-
sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/standard.cpp | 3
sandbox/assign_v2/libs/assign/v2/test/put/pipe/put.cpp | 4
sandbox/assign_v2/libs/assign/v2/test/put/put.cpp | 6 +-
sandbox/assign_v2/libs/assign/v2/test/ref/array.cpp | 17 ++----
sandbox/assign_v2/libs/assign/v2/test/ref/csv_array.cpp | 18 ++----
sandbox/assign_v2/libs/assign/v2/test/utility.cpp | 3
sandbox/assign_v2/libs/assign/v2/test/utility/conversion.cpp | 99 ++++++++++++++++++---------------------
11 files changed, 91 insertions(+), 130 deletions(-)
Modified: sandbox/assign_v2/libs/assign/v2/src/main.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/src/main.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/src/main.cpp 2011-03-14 17:02:24 EDT (Mon, 14 Mar 2011)
@@ -1,11 +1,10 @@
// Test
//#include <libs/assign/v2/test/detail.h>
-//#include <libs/assign/v2/test/ref.h>
+#include <libs/assign/v2/test/ref.h>
//#include <libs/assign/v2/test/mix.h>
#include <libs/assign/v2/test/put.h>
-//#include <libs/assign/v2/test/utility.h>
-//#include <libs/assign/v2/test/other.h>
+#include <libs/assign/v2/test/utility.h>
// Speed
//#include <fstream>
@@ -48,8 +47,8 @@
using namespace test_assign_v2;
xxx_put::test();
//xxx_mix::test();
- //xxx_ref::test();
- //xxx_utility::test();
+ xxx_ref::test();
+ xxx_utility::test();
}
/*
Modified: sandbox/assign_v2/libs/assign/v2/test/mix.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/mix.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/mix.cpp 2011-03-14 17:02:24 EDT (Mon, 14 Mar 2011)
@@ -61,7 +61,7 @@
{
//[mix_bitset_revisited
typedef std::string str_; typedef std::bitset<3> data_;
- std::vector<data_> consecutive; as2::put( consecutive )( as2::as_arg_list( as2::csv_deque</*Explicit template argument `std::string` is required, because the deduced argument would be `const char*`, and only the former is a valid argument to `data_`'s constructor*/std::string>( "000", "001", "010", "011", "100", "101", "110", "111" ) ) );
+ std::vector<data_> consecutive; as2::put( consecutive )( as2::_as_arg_list( as2::csv_deque</*Explicit template argument `std::string` is required, because the deduced argument would be `const char*`, and only the former is a valid argument to `data_`'s constructor*/std::string>( "000", "001", "010", "011", "100", "101", "110", "111" ) ) );
for(int i = 0; i < consecutive.size(); i++)
{
@@ -70,22 +70,6 @@
//]
}
{
- //[mix_maxtrix3x3
- const int sz = 3;
- typedef array<int, sz> row_;
- array<row_, sz> matrix3x3 = converter(
- as2::ref::array
- ( as2::ref::csv_array( 1, 2, 3 ) | as2::_convert<row_>() )
- ( as2::ref::csv_array( 4, 5, 6 ) | as2::_convert<row_>() )
- ( as2::ref::csv_array( 7, 8, 9 ) | as2::_convert<row_>() )
- );
- for(int i = 0; i < 9; i++)
- {
- BOOST_ASSIGN_V2_CHECK( matrix3x3[ i / 3 ][ i % 3 ] == i + 1 );
- }
- //]
- }
- {
//[mix_ragged
typedef double data_; typedef std::list<data_> variable_size_; typedef std::vector<variable_size_> ragged_;
Modified: sandbox/assign_v2/libs/assign/v2/test/put/deque.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/deque.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/deque.cpp 2011-03-14 17:02:24 EDT (Mon, 14 Mar 2011)
@@ -8,8 +8,8 @@
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
////////////////////////////////////////////////////////////////////////////
#include <string>
-#include <boost/array.hpp>
-#include <boost/tuple/tuple.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_same.hpp>
#include <boost/assign/v2/detail/config/check.hpp>
#include <boost/assign/v2/detail/pp/ignore.hpp>
#include <boost/assign/v2/put/deque/csv_deque.hpp>
@@ -28,26 +28,20 @@
namespace as2 = assign::v2;
{
//[test_put_deque_ints
- {
- typedef as2::result_of::deque<int>::type C;
- C empty_cont = as2::deque<int>( as2::_nil );
-
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/ empty_cont( 72 )( 31 )( 48 ).front() == 72 );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/ as2::deque<int>( 72 )( 31 )( 48 ).back() == 48 );
- }
- typedef as2::result_of::csv_deque<int>::type C;
- {
- C cont = as2::csv_deque( 72, 31, 48 );
-
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/ cont.front() == 72 );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/ cont.back() == 48 );
- }
- {
- C cont = as2::csv_deque( 72, 31 )/*<<This seeming oddity is possible thanks to `result_of::csv_deque<int>::type == result_of::deque<int>::type`>>*/( 48 );
-
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/ cont.front() == 72 );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/ cont.back() == 48 );
- }
+ typedef as2::result_of::deque<int>::type C0;
+ C0 empty_cont = as2::deque<int>( as2::_nil );
+
+ /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/ empty_cont( 72 )( 31 )( 48 ).front() == 72 );
+ /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/ as2::deque<int>( 72 )( 31 )( 48 ).back() == 48 );
+
+ typedef as2::result_of::csv_deque<int>::type C1;
+ C1 cont = as2::csv_deque( 72, 31, 48 );
+
+ /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/ cont.front() == 72 );
+ /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/ as2::csv_deque( 72 )( 31 )( 48 ).back() == 48 );
+
+ BOOST_MPL_ASSERT(( is_same<C0, C1> ));
+
//]
}
{
Modified: sandbox/assign_v2/libs/assign/v2/test/put/modifier/iterate.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/modifier/iterate.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/modifier/iterate.cpp 2011-03-14 17:02:24 EDT (Mon, 14 Mar 2011)
@@ -52,7 +52,7 @@
{
//[test_put_modifier_iterate_shifted
typedef int T; array<T, 4> powers; powers[0] = 1; powers[1] = 10;
- int i = 2; ( as2::put( powers ) % ( as2::_iterate = var( i )++ ) )( 100 )( 1000 );
+ int shift = 2; ( as2::put( powers ) % ( as2::_iterate = var( shift )++ ) )( 100 )( 1000 );
/*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/powers[0] == 1 );
/*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/powers[1] == 10 );
@@ -77,11 +77,11 @@
{
//[test_put_modifier_iterate_shifted_deque
as2::result_of::deque<int>::type missing_tail = as2::deque<int>( 1 )( 10 )( -1 )( -1 );
- int i = 2;
+ int shift = 2;
BOOST_AUTO(
powers,
- ( missing_tail % ( as2::_iterate = var( i )++ ) )( 100 )( 1000 )
+ ( missing_tail % ( as2::_iterate = var( shift )++ ) )( 100 )( 1000 )
);
/*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/powers[0] == 1 );
Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/standard.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/standard.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/standard.cpp 2011-03-14 17:02:24 EDT (Mon, 14 Mar 2011)
@@ -18,6 +18,7 @@
#include <boost/assign/v2/detail/config/check.hpp>
#include <boost/assign/v2/detail/pp/ignore.hpp>
#include <boost/assign/v2/put/modifier/standard.hpp>
+#include <boost/assign/v2/put/pipe/csv_put.hpp>
#include <boost/assign/v2/put/pipe/put.hpp>
#include <boost/assign/v2/put/deque.hpp>
#include <libs/assign/v2/test/put/pipe/modifier/standard.h>
@@ -42,7 +43,7 @@
{
//[test_put_pipe_modifier_push_front
std::deque<int> powers; int front = (
- powers | ( as2::_put % as2::_push_front )( 16 )( 8 )( 4 )( 2 )( 1 )
+ powers | ( as2::_csv_put % as2::_push_front )( 16, 8, 4, 2, 1 )
).front();
/*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/front == 1 );
Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/put.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/put.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/put.cpp 2011-03-14 17:02:24 EDT (Mon, 14 Mar 2011)
@@ -35,7 +35,7 @@
typedef const char* T; typedef std::string str_; std::deque<T> cont;
/*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/
boost::range::equal(
- cont | as2::_put( "x" )( "y" )( "z" ),
+ cont | /*<<`"x"`, `"y"` and `"z"` are kept as `const char(&)[2]`>>*/as2::_csv_put( "x", "y", "z" ),
as2::csv_deque( "x" )( "y" )( "z" )
)
);
@@ -48,7 +48,7 @@
boost::array<int, 2> interval; boost::array<int, 6> all6;
BOOST_ASSIGN_V2_CHECK(
boost::range::equal(
- all6 | as2::_put( 1 )( 2 )( as2::as_arg_list( interval | as2::_csv_put( 3, 4 ) ) )( 5 )( 6 ),
+ all6 | as2::_put( 1 )( 2 )( as2::_as_arg_list( interval | as2::_csv_put( 3, 4 ) ) )( 5 )( 6 ),
as2::csv_deque( 1, 2, 3, 4, 5, 6 )
)
);
Modified: sandbox/assign_v2/libs/assign/v2/test/put/put.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/put.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/put.cpp 2011-03-14 17:02:24 EDT (Mon, 14 Mar 2011)
@@ -64,7 +64,7 @@
//[test_put_put_numeric_kb
std::vector<int> numeric( 10 ); iota( numeric, 0 ); typedef std::string str_;
typedef variant< int, str_ > data_; array<data_, 16> numeric_kb;
- as2::put( numeric_kb )/*<<Calls `numeric_kb[ i ] = data_( t )` for [^( i, t ) = ( 0, "+" ), ..., ( 5, "." )]>>*/( "+" )( "-" )( "*" )( "/" )( "=" )( "." )/*<<Calls `numeric_kb[ 6 + i ] = data_( *( b + i ) )` for [^i = 0, ..., 9] and [^b =] `boost::begin( numeric )`>>*/( as2::as_arg_list( numeric ) );
+ as2::put( numeric_kb )/*<<Calls `numeric_kb[ i ] = data_( t )` for [^( i, t ) = ( 0, "+" ), ..., ( 5, "." )]>>*/( "+" )( "-" )( "*" )( "/" )( "=" )( "." )/*<<Calls `numeric_kb[ 6 + i ] = data_( *( b + i ) )` for [^i = 0, ..., 9] and [^b =] `boost::begin( numeric )`>>*/( as2::_as_arg_list( numeric ) );
assert( get<str_>( numeric_kb.front() ) == "+" );
assert( get<int>( numeric_kb.back() ) == 9 );
@@ -103,7 +103,7 @@
}
{
//[test_put_put_stl
- std::queue<int> adapter; /*<<Calls `fifo.push( t )` for [^t = 72, 31, 48]>>*/as2::put( adapter )( 72 )( 31 )( 48 );
+ std::queue<int> adapter; /*<<Calls `adapter.push( t )` for [^t = 72, 31, 48]>>*/as2::put( adapter )( 72 )( 31 )( 48 );
array<int, 3> array; /*<<Calls `array[i] = t` for [^( i, t ) = ( 0, 72 ), ( 1, 31 ), ( 2, 48 )]>>*/as2::put( array )( 72 )( 31 )( 48 );
std::set<int> assoc; /*<<Calls `assoc.insert( t )` for [^t = 72, 31, 48]>>*/as2::put( assoc )( 72 )( 31 )( 48 );
std::list<int> seq; /*<<Calls `seq.push_back( t )` for [^t = 72, 31, 48]>>*/as2::put( seq )( 72 )( 31 )( 48 );
@@ -119,7 +119,7 @@
}
{
// http://bioinfo.mbb.yale.edu/~mbg/dom/fun3/area-codes/
- //[put_put_put_area_codes
+ //[test_put_put_area_codes
typedef const char us_state_ [3]; us_state_ ct = "CT", nj = "NJ", ny = "NY";
typedef int area_code_; typedef tuple<us_state_/*<<Notice the [*reference]>>*/&, area_code_> data_; std::deque< data_ > tri_state_area;
/*<<Calls `tri_state.push_back( data_( s, c ) )` for [^( s, c ) =( ny, 212 )...( ct, 203 )]>>*/
Modified: sandbox/assign_v2/libs/assign/v2/test/ref/array.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/ref/array.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/ref/array.cpp 2011-03-14 17:02:24 EDT (Mon, 14 Mar 2011)
@@ -26,7 +26,7 @@
using namespace boost;
namespace as2 = assign::v2;
{
- //[ref_array_r
+ //[test_ref_array_read
typedef int const T;
T w = 11, x = 72, y = 31, z = 48;
as2::ref::nth_result_of::array<3, T>::type ar3 = as2::ref::array( w )( x )( y );
@@ -53,22 +53,17 @@
}
}
{
- //[ref_array_w
- typedef int T; T x, y, z;
- std::vector<T> r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
- boost::copy( r, begin(
- as2::ref::array( x )( y )( z ) | as2::ref::_get
- )
- );
+ //[test_ref_array_write
+ typedef int T; T x, y, z; std::vector<T> r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
+ boost::copy( r, begin( as2::ref::array( x )( y )( z ) | as2::ref::_get ) );
BOOST_ASSIGN_V2_CHECK( x == r[0] );
BOOST_ASSIGN_V2_CHECK( z == r[2] );
//]
}
{
- //[ref_array_assign
- typedef int T; T x, y, z;
- as2::ref::array( x )( y )( z ).assign( -1 );
+ //[test_ref_array_assign
+ typedef int T; T x, y, z; as2::ref::array( x )( y )( z ).assign( -1 );
BOOST_ASSIGN_V2_CHECK( x == -1 );
BOOST_ASSIGN_V2_CHECK( z == -1 );
Modified: sandbox/assign_v2/libs/assign/v2/test/ref/csv_array.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/ref/csv_array.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/ref/csv_array.cpp 2011-03-14 17:02:24 EDT (Mon, 14 Mar 2011)
@@ -25,17 +25,17 @@
using namespace boost;
namespace as2 = assign::v2;
{
- //[ref_csv_array
+ //[test_ref_csv_array_read
typedef int const T;
T x = 72, y = 31, z = 48;
typedef as2::ref::nth_result_of::csv_array<3, T>::type ar_;
ar_ ar = as2::ref::csv_array( x, y, z );
- {
+ /*<-*/{/*->*/
T& a = ar[0]; T& b = ar[2];
BOOST_ASSIGN_V2_CHECK( &a == &x );
BOOST_ASSIGN_V2_CHECK( &b == &z );
- }
+ /*<-*/}/*->*/
//]
{
T& a = ar.front(); T& b = ar.back();
@@ -52,22 +52,18 @@
}
}
{
- //[ref_csv_array_w
+ //[test_ref_csv_array_write
typedef int T; T x, y, z;
std::vector<T> r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
- boost::copy( r, begin(
- as2::ref::csv_array( x, y, z ) | as2::ref::_get
- )
- );
+ boost::copy( r, begin( as2::ref::csv_array( x, y, z ) | as2::ref::_get ) );
BOOST_ASSIGN_V2_CHECK( x == r[0] );
BOOST_ASSIGN_V2_CHECK( z == r[2] );
//]
}
{
- //[ref_csv_array_assign
- typedef int T; T x, y, z;
- as2::ref::csv_array( x, y, z ).assign( -1 );
+ //[test_ref_csv_array_assign
+ int x, y, z; as2::ref::csv_array( x, y, z ).assign( -1 );
BOOST_ASSIGN_V2_CHECK( x == -1 );
BOOST_ASSIGN_V2_CHECK( z == -1 );
Modified: sandbox/assign_v2/libs/assign/v2/test/utility.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/utility.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/utility.cpp 2011-03-14 17:02:24 EDT (Mon, 14 Mar 2011)
@@ -8,6 +8,7 @@
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
//////////////////////////////////////////////////////////////////////////////
#include <libs/assign/v2/test/utility/chain.h>
+#include <libs/assign/v2/test/utility/csv.h>
#include <libs/assign/v2/test/utility/conversion.h>
#include <libs/assign/v2/test/utility.h>
@@ -16,7 +17,7 @@
void test()
{
- xxx_chain::test();
+ //xxx_chain::test();
xxx_conversion::test();
}
Modified: sandbox/assign_v2/libs/assign/v2/test/utility/conversion.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/utility/conversion.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/utility/conversion.cpp 2011-03-14 17:02:24 EDT (Mon, 14 Mar 2011)
@@ -18,13 +18,12 @@
#include <boost/assign/v2/put/deque.hpp>
#include <libs/assign/v2/test/utility/conversion.h>
-
namespace test_assign_v2{
namespace xxx_utility{
namespace xxx_conversion{
// suggested by JB:
- //[convert_f
+ //[test_utility_conversion_f
template<typename C, typename R>
void f(C cont, R const& r){
namespace as2 = boost::assign::v2;
@@ -38,80 +37,72 @@
namespace as2 = assign::v2;
namespace ns = as2::check_aux;
- // Non-Boost.Assign.2.0 containers - fully qualified as2::converter()
+ // External containers (fully qualified)
{
- //[convert_inpl
- std::vector<int> v( 3 ); v[0] = 72; v[1] = 31; v[2] = 48;
- typedef array<int, 3> ar_;
- BOOST_ASSIGN_V2_CHECK(
- ( as2::converter( v ).type<ar_>() )[1] == v[1]
- );
+ //[test_utility_conversion_vec_array
+ std::vector<int> r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
+ typedef array<int, 3> ar_; ar_ const& ar = ( r | as2::_convert<ar_>() );
+
+ BOOST_ASSIGN_V2_CHECK( ar.front() == 72 );
+ BOOST_ASSIGN_V2_CHECK( ar.back() == 48 );
//]
- BOOST_ASSIGN_V2_CHECK(
- ( as2::converter( v ).type<ar_>() )[0] == v[0]
- );
- BOOST_ASSIGN_V2_CHECK(
- ( as2::converter( v ).type<ar_>() )[2] == v[2]
- );
}
{
- //[convert_copy
- std::vector<int> v( 3 ); v[0] = 72; v[1] = 31; v[2] = 48;
- std::stack<int> lifo = as2::converter( v );
+ //[test_utility_conversion_vec_stack
+ std::vector<int> r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
+ std::stack<int> lifo = as2::converter( r );
BOOST_ASSIGN_V2_CHECK( lifo.top() == 48 );
//]
}
{
+ //test_utility_conversion_stl
+ typedef int T; typedef std::vector<T> R; R r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
+ f< std::vector<T> >( as2::converter( r ), r );
+ f< std::deque<T> >( as2::converter( r ), r );
+ f< std::list<T> >( as2::converter( r ), r );
+ f< std::stack<T> >( as2::converter( r ), r );
+ f< std::queue<T> >( as2::converter( r ), r );
+ //]
+ }
+ {
+ //[test_utility_conversion_matrix3x3
+ const int sz = 3; typedef array<int, sz> row_;
+ array<row_, sz> matrix3x3 = converter(
+ as2::ref::array
+ ( as2::ref::csv_array( 1, 2, 3 ) | as2::_convert<row_>() )
+ ( as2::ref::csv_array( 4, 5, 6 ) | as2::_convert<row_>() )
+ ( as2::ref::csv_array( 7, 8, 9 ) | as2::_convert<row_>() )
+ );
+ for(int i = 0; i < 9; i++)
{
- typedef int T;
- typedef std::vector<T> R; R r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
- typedef std::vector<T> C; f<C>( as2::converter( r ), r );
- }
- {
- typedef int T;
- typedef std::vector<T> R; R r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
- typedef std::deque<T> C; f<C>( as2::converter( r ), r );
- }
- {
- typedef int T;
- typedef std::vector<T> R; R r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
- typedef std::list<T> C; f<C>( as2::converter( r ), r );
- }
- {
- //[convert_f_invoke
- typedef int T;
- typedef std::vector<T> R; R r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
- typedef std::stack<T> C; f<C>( as2::converter( r ), r );
- //]
- }
- {
- typedef int T;
- typedef std::vector<T> R; R r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
- typedef std::queue<T> C; f<C>( as2::converter( r ), r );
+ BOOST_ASSIGN_V2_CHECK( matrix3x3[ i / 3 ][ i % 3 ] == i + 1 );
}
+ //]
}
-
- // Non-Boost.Assign.2.0 containers - name lookup
+ // Boost.Assign.2.0 containers - name lookup
{
- //[convert_array
- std::stack<int> lifo = /*<<Notice unqualified (name lookup)>>*/converter( as2::ref::array( 72 )( 31 )( 48 ) );
- BOOST_ASSIGN_V2_CHECK( lifo.top() == 48 );
+ //[test_utility_conversion_as2_deque_array
+ std::vector<int> r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
+ typedef array<int, 3> ar_; ar_ const& ar = ( as2::csv_deque( 72, 31, 48 ) | as2::_convert<ar_>() );
+
+ BOOST_ASSIGN_V2_CHECK( ar.front() == 72 );
+ BOOST_ASSIGN_V2_CHECK( ar.back() == 48 );
//]
}
{
- //[convert_csv_array
- std::stack<int> lifo = /*<<Notice unqualified (name lookup)>>*/converter( as2::ref::csv_array( 72, 31, 48 ) );
+ //[test_utility_conversion_ref_array_stack
+ std::stack<int> lifo = /*<<Notice unqualified (name lookup)>>*/converter( as2::ref::array( 72 )( 31 )( 48 ) );
BOOST_ASSIGN_V2_CHECK( lifo.top() == 48 );
//]
}
{
- //[convert_deque
- std::stack<int> lifo = /*<<Notice unqualified (name lookup)>>*/converter( as2::deque<int>( 72 )( 31 )( 48 ) );
- BOOST_ASSIGN_V2_CHECK( lifo.top() == 48 );
+ //[test_utility_conversion_ref_array_queue
+ std::queue<int> fifo = /*<<Notice unqualified (name lookup)>>*/converter( as2::ref::csv_array( 72, 31, 48 ) );
+ BOOST_ASSIGN_V2_CHECK( fifo.front() == 72 );
//]
}
{
- //[convert_csv_array
+ //[test_utility_conversion_as2_deque_stack
std::stack<int> lifo = /*<<Notice unqualified (name lookup)>>*/converter( as2::csv_deque( 72, 31, 48 ) );
BOOST_ASSIGN_V2_CHECK( lifo.top() == 48 );
//]
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