|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r68081 - in sandbox/statistics/support/libs/assign/v2: example/put example/ref example/utility src test test/put test/put/pipe test/ref test/utility
From: erwann.rogard_at_[hidden]
Date: 2011-01-13 00:33:10
Author: e_r
Date: 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
New Revision: 68081
URL: http://svn.boost.org/trac/boost/changeset/68081
Log:
upd libs/assign/v2
Text files modified:
sandbox/statistics/support/libs/assign/v2/example/put/pipe.cpp | 7 +++++++
sandbox/statistics/support/libs/assign/v2/example/ref/array.cpp | 17 +++++++++++++++++
sandbox/statistics/support/libs/assign/v2/example/utility/chain.cpp | 17 ++++++++++-------
sandbox/statistics/support/libs/assign/v2/src/main.cpp | 21 +++++++++++++--------
sandbox/statistics/support/libs/assign/v2/test/put/pipe/csv.cpp | 2 +-
sandbox/statistics/support/libs/assign/v2/test/put/ptr.cpp | 8 ++++----
sandbox/statistics/support/libs/assign/v2/test/put/stl.cpp | 14 +++++++-------
sandbox/statistics/support/libs/assign/v2/test/ref/array.cpp | 28 +++++++++++++++-------------
sandbox/statistics/support/libs/assign/v2/test/ref/convert_traits.cpp | 7 +++++--
sandbox/statistics/support/libs/assign/v2/test/ref/csv_array.cpp | 39 +++++++++++++++++++++++----------------
sandbox/statistics/support/libs/assign/v2/test/ref/fusion.cpp | 6 +++---
sandbox/statistics/support/libs/assign/v2/test/ref/wrapper.cpp | 8 ++++----
sandbox/statistics/support/libs/assign/v2/test/utility.cpp | 3 ++-
sandbox/statistics/support/libs/assign/v2/test/utility/chain.cpp | 8 ++++----
14 files changed, 115 insertions(+), 70 deletions(-)
Modified: sandbox/statistics/support/libs/assign/v2/example/put/pipe.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/example/put/pipe.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/example/put/pipe.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -102,6 +102,12 @@
{
//[fun
std::vector<int> cont;
+ cont | (
+ as2::_csv_put % (
+ as2::_fun = (2 * bl::_1)
+ )
+ )( -1, 0, 1 );
+/*
boost::for_each(
cont | (
as2::_csv_put % (
@@ -110,6 +116,7 @@
)( -1, 0, 1 ),
os << bl::_1 << ' '
); // outputs -2 0 2
+*/
//]
os << std::endl;
}
Modified: sandbox/statistics/support/libs/assign/v2/example/ref/array.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/example/ref/array.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/example/ref/array.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -9,6 +9,7 @@
//////////////////////////////////////////////////////////////////////////////
#include <vector>
+#include <boost/assign/v2/ref/wrapper/get.hpp>
#include <boost/assign/v2/ref/array/csv.hpp>
#include <boost/assign/v2/ref/array/functor.hpp>
#include <boost/range/algorithm/for_each.hpp>
@@ -45,6 +46,22 @@
as2::ref::csv_array<int const>( as2::_nil );
//]
}
+ {
+ //[csv_array_w2
+ std::vector<int> v( 3 ); v[0] = -1; v[1] = 0; v[2] = 1;
+ int x, y, z;
+ boost::copy(
+ v,
+ boost::begin(
+ as2::ref::csv_array( x, y, z )
+ | as2::ref::_get
+ )
+ );
+ assert( x == -1 );
+ assert( z == 1 );
+ //]
+
+ }
{
//[array_r
boost::for_each(
Modified: sandbox/statistics/support/libs/assign/v2/example/utility/chain.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/example/utility/chain.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/example/utility/chain.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -36,18 +36,21 @@
}
{
//[chain_w
- int const x = -1; int y; boost::array<int, 2> ar;
+ std::vector<int> v( 3 ); v[0] = -1; v[1] = 0; v[2] = 1;
+ boost::array<int, 2> ar; int z;
boost::copy(
- std::vector<int>(3, x),
+ v,
boost::begin(
ar /* lvalue */ | as2::_chain(
- as2::ref::csv_array( y /* lvalue */ )
- ) /* rvalue */
+ as2::ref::csv_array(
+ z /* lvalue */
+ ) /* rvalue */ | as2::ref::_get
+ )
)
);
- assert( ar[0] == x );
- assert( ar[1] == x );
- assert( y == x );
+ assert( ar[0] == -1 );
+ assert( ar[1] == 0 );
+ assert( z == 1 );
//]
}
}
Modified: sandbox/statistics/support/libs/assign/v2/src/main.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/src/main.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/src/main.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -1,29 +1,34 @@
#include <iostream>
#include <boost/assert.hpp>
+#include <libs/assign/v2/example/utility.h>
+#include <libs/assign/v2/example/ref.h>
+#include <libs/assign/v2/example/put.h>
#include <libs/assign/v2/test/detail.h>
-#include <libs/assign/v2/test/utility.h>
#include <libs/assign/v2/test/put.h>
#include <libs/assign/v2/test/ref.h>
-#include <libs/assign/v2/example/ref.h>
-#include <libs/assign/v2/example/put.h>
-#include <libs/assign/v2/example/utility.h>
+#include <libs/assign/v2/test/utility.h>
+
+#include <libs/assign/v2/test/utility/convert.h>
+#include <libs/assign/v2/test/utility/chain.h>
+
+
+#include <libs/assign/v2/test/ref/csv_array.h>
int main (int argc, char * const argv[])
{
// Do not put libs/assign/v2/test/unit_testing in this project
-
{
using namespace test_assign_v2;
xxx_detail::test();
- xxx_utility::test();
+ xxx_utility::xxx_chain::test();
xxx_put::test();
xxx_ref::test();
}
{
using namespace example_assign_v2;
- xxx_ref::run(std::cout);
- xxx_put::run(std::cout);
+// xxx_ref::run(std::cout);
+// xxx_put::run(std::cout);
xxx_utility::run(std::cout);
}
return 0;
Modified: sandbox/statistics/support/libs/assign/v2/test/put/pipe/csv.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/put/pipe/csv.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/put/pipe/csv.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -35,7 +35,7 @@
a1 = a; b1 = b; c1 = c; d1 = d;
}
-#define MACRO1(i) tmp.seq_args()[ i ]
+#define MACRO1(i) tmp.seq_args()[ i ].get()
#define MACRO2(i,X) BOOST_ASSIGN_V2_CHECK( &X == &MACRO1(i) );
#define MACRO3(i,X) BOOST_ASSIGN_V2_CHECK( X == MACRO1(i) );
Modified: sandbox/statistics/support/libs/assign/v2/test/put/ptr.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/put/ptr.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/put/ptr.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -34,7 +34,7 @@
namespace ns = as2::checking::container;
ns::do_check(
as2::csv_put( cont )
- ( a , b , c , d , e , f , g , h ).unwrap()
+ ( a , b , c , d , e , f , g , h ).get()
);
}
}
@@ -49,7 +49,7 @@
namespace ns = as2::checking::container;
ns::do_check(
as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ ( a )( b )( c )( d )( e )( f )( g )( h ).get()
);
}
}// ptr_deque
@@ -61,7 +61,7 @@
namespace ns = as2::checking::container;
ns::do_check(
as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ ( a )( b )( c )( d )( e )( f )( g )( h ).get()
);
}
}// ptr_list
@@ -73,7 +73,7 @@
namespace ns = as2::checking::container;
ns::do_check(
as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ ( a )( b )( c )( d )( e )( f )( g )( h ).get()
);
}
}// ptr_vector
Modified: sandbox/statistics/support/libs/assign/v2/test/put/stl.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/put/stl.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/put/stl.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -57,7 +57,7 @@
as2::put( cont )
( a, a )( b, b )( c, c )
( d, d )( e, e )( f, f )
- ( g, g )( h, h ).unwrap()
+ ( g, g )( h, h ).get()
);
}
}// map
@@ -71,7 +71,7 @@
as2::put( cont )
( a )( b )( c )
( d )( e )( f )
- ( g )( h ).unwrap()
+ ( g )( h ).get()
);
}
}// map
@@ -86,7 +86,7 @@
namespace ns = as2::checking::container;
ns::do_check(
as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ ( a )( b )( c )( d )( e )( f )( g )( h ).get()
);
}
}// deque
@@ -98,7 +98,7 @@
namespace ns = as2::checking::container;
ns::do_check(
as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ ( a )( b )( c )( d )( e )( f )( g )( h ).get()
);
}
}// list
@@ -110,7 +110,7 @@
namespace ns = as2::checking::container;
ns::do_check(
as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ ( a )( b )( c )( d )( e )( f )( g )( h ).get()
);
}
}// vector
@@ -125,7 +125,7 @@
namespace ns = as2::checking::container;
ns::do_check(
as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ ( a )( b )( c )( d )( e )( f )( g )( h ).get()
);
}
}// queue
@@ -138,7 +138,7 @@
namespace ns = as2::checking::container;
ns::do_check(
as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).unwrap()
+ ( a )( b )( c )( d )( e )( f )( g )( h ).get()
);
}
}// queue
Modified: sandbox/statistics/support/libs/assign/v2/test/ref/array.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/ref/array.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/ref/array.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -24,7 +24,7 @@
#include <boost/assign/v2/detail/checking/container.hpp>
#include <boost/assign/v2/detail/checking/array.hpp>
#include <boost/assign/v2/ref/array/functor.hpp>
-#include <boost/assign/v2/ref/wrapper/copy.hpp>
+#include <boost/assign/v2/ref/wrapper.hpp>
#include <libs/assign/v2/test/ref/array.h>
namespace test_assign_v2{
@@ -33,16 +33,17 @@
void test()
{
- using namespace boost::assign::v2;
+ namespace as2 = boost::assign::v2;
{
// Array
- typedef ref::nth_result_of::array<8, int const>::type ar_;
- using namespace checking::constants;
- ar_ ar = ref::array( a )( b )( c )( d )( e )( f )( g )( h );
+ typedef as2::ref::nth_result_of::array<8, int const>::type ar_;
+ using namespace as2::checking::constants;
+ ar_ ar = as2::ref::array( a )( b )( c )( d )( e )( f )( g )( h );
{
- using namespace checking;
- typedef container_tag::static_array tag_;
- do_check(tag_(), ar );
+
+ typedef as2::container_tag::static_array tag_;
+ namespace ns = as2::checking::container;
+ as2::checking::do_check(tag_(), ar );
}
}
{
@@ -51,7 +52,7 @@
typedef std::vector<int> vec_;
vec_ vec;
{
- using namespace checking::constants;
+ using namespace as2::checking::constants;
vec.push_back( a );
vec.push_back( b );
vec.push_back( c );
@@ -63,13 +64,14 @@
}
boost::copy(
vec,
- boost::begin( ref::array
- ( a1 )( b1 )( c1 )( d1 )( e1 )( f1 )( g1 )( h1 )
+ boost::begin(
+ as2::ref::array( a1 )( b1 )( c1 )( d1 )
+ ( e1 )( f1 )( g1 )( h1 ) | as2::ref::_get
)
);
{
- namespace ns = checking::container;
- ns::do_check( ref::array<int const>
+ namespace ns = as2::checking::container;
+ ns::do_check( as2::ref::array<int const>
( a1 )( b1 )( c1 )( d1 )( e1 )( f1 )( g1 )( h1 )
);
}
Modified: sandbox/statistics/support/libs/assign/v2/test/ref/convert_traits.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/ref/convert_traits.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/ref/convert_traits.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -7,7 +7,7 @@
// Boost Software License, Version 1.0. (See accompanying file //
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
//////////////////////////////////////////////////////////////////////////////
-#include <boost/assign/v2/ref/detail/convert_traits/checking.hpp>
+#include <boost/assign/v2/ref/convert_traits/checking.hpp>
#include <libs/assign/v2/test/ref/convert_traits.h>
namespace test_assign_v2{
@@ -19,8 +19,10 @@
namespace as2 = boost::assign::v2;
namespace ns = as2::ref::convert_traits::checking;
{
- ns::twin_values::do_check<int>();
+ ns::same_value_type::do_check<int>();
}
+// TODO, in the future
+/*
{
namespace dv = ns::distinct_values;
namespace ari = dv::arithmetic;
@@ -29,6 +31,7 @@
ari::do_check<float>();
ari::do_check<double>();
}
+*/
}
}// convert_traits
Modified: sandbox/statistics/support/libs/assign/v2/test/ref/csv_array.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/ref/csv_array.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/ref/csv_array.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -17,6 +17,7 @@
#include <boost/assign/v2/detail/checking/range.hpp>
#include <boost/assign/v2/detail/checking/array.hpp>
#include <boost/assign/v2/ref/array/csv.hpp>
+#include <boost/assign/v2/ref/wrapper.hpp>
#include <libs/assign/v2/test/ref/csv_array.h>
namespace test_assign_v2{
@@ -25,20 +26,25 @@
void test()
{
- using namespace boost::assign::v2;
- typedef ref::assign_tag::copy copy_;
+ namespace as2 = boost::assign::v2;
+ typedef as2::ref::assign_tag::copy copy_;
+
+ using namespace as2::checking::constants;
{
- typedef ref::nth_result_of::csv_array<8, int const>::type ar_;
- using namespace checking::constants;
- ar_ ar = ref::csv_array( a , b , c , d , e , f , g , h );
- using namespace checking;
+ typedef as2::ref::nth_result_of::csv_array<8, int const>::type ar_;
+ using namespace as2::checking::constants;
+ ar_ ar = as2::ref::csv_array( a , b , c , d , e , f , g , h );
+ {
+ typedef as2::container_tag::static_array tag_;
+ as2::checking::do_check(tag_(), ar );
+ }
{
- typedef container_tag::static_array tag_;
- checking::do_check(tag_(), ar );
+ namespace ns = as2::checking::iterator;
+ ns::do_check( boost::begin( ar ) );
}
{
- typedef container_tag::range tag_;
- checking::do_check(tag_(), ar );
+ typedef as2::container_tag::range tag_;
+ as2::checking::do_check(tag_(), ar );
}
}
{
@@ -46,7 +52,7 @@
typedef std::vector<int> vec_;
vec_ vec;
{
- using namespace checking::constants;
+ using namespace as2::checking::constants;
vec.push_back( a );
vec.push_back( b );
vec.push_back( c );
@@ -59,15 +65,16 @@
boost::copy(
vec,
boost::begin(
- ref::csv_array( a1 , b1 , c1 , d1 , e1 , f1 , g1 , h1 )
+ as2::ref::csv_array(
+ a1 , b1 , c1 , d1 , e1 , f1 , g1 , h1
+ ) | as2::ref::_get
)
);
{
- using namespace checking;
- typedef container_tag::static_array tag_;
- do_check(
+ typedef as2::container_tag::static_array tag_;
+ as2::checking::do_check(
tag_(),
- ref::csv_array<int const>(
+ as2::ref::csv_array<int const>(
a1 , b1 , c1 , d1 , e1 , f1 , g1 , h1
)
);
Modified: sandbox/statistics/support/libs/assign/v2/test/ref/fusion.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/ref/fusion.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/ref/fusion.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -80,9 +80,9 @@
ar_ ar = fusion<tag1_, tag2_>( _nil )( a )( b )( c );
arw_ arw;
assign_array( arw, ar );
- BOOST_ASSIGN_V2_CHECK( &arw[ 0 ].unwrap() == &a );
- BOOST_ASSIGN_V2_CHECK( &arw[ 1 ].unwrap() == &b );
- BOOST_ASSIGN_V2_CHECK( &arw[ 2 ].unwrap() == &c );
+ BOOST_ASSIGN_V2_CHECK( &arw[ 0 ].get() == &a );
+ BOOST_ASSIGN_V2_CHECK( &arw[ 1 ].get() == &b );
+ BOOST_ASSIGN_V2_CHECK( &arw[ 2 ].get() == &c );
}
}
Modified: sandbox/statistics/support/libs/assign/v2/test/ref/wrapper.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/ref/wrapper.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/ref/wrapper.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -25,7 +25,7 @@
typedef ref::copy_wrapper<val_>::type w_;
w_ w;
val_ a = 1, b = 2, c = 3;
- w.rebind( a ); BOOST_ASSIGN_V2_CHECK( &w.unwrap() == &a );
+ w.rebind( a ); BOOST_ASSIGN_V2_CHECK( &w.get() == &a );
w.assign( b ); BOOST_ASSIGN_V2_CHECK( a == b );
w = c; BOOST_ASSIGN_V2_CHECK( a == c );
}
@@ -33,7 +33,7 @@
typedef ref::copy_wrapper<val_ const>::type w_;
w_ w;
val_ a = 1;
- w.rebind( a ); BOOST_ASSIGN_V2_CHECK( &w.unwrap() == &a );
+ w.rebind( a ); BOOST_ASSIGN_V2_CHECK( &w.get() == &a );
}
#if BOOST_ASSIGN_V2_ENABLE_CPP0X
{
@@ -44,12 +44,12 @@
{
val_&& a = 1;
w_ w( a );
- BOOST_ASSIGN_V2_CHECK( &w.unwrap() == &a );
+ BOOST_ASSIGN_V2_CHECK( &w.get() == &a );
}
{
cval_ a = 1;
w_ w = w_( 1 );
- BOOST_ASSIGN_V2_CHECK( w.unwrap() == a );
+ BOOST_ASSIGN_V2_CHECK( w.get() == a );
}
}
#endif
Modified: sandbox/statistics/support/libs/assign/v2/test/utility.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/utility.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/utility.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -14,7 +14,8 @@
namespace test_assign_v2{
namespace xxx_utility{
- void test(){
+ void test()
+ {
xxx_chain::test();
xxx_convert::test();
}
Modified: sandbox/statistics/support/libs/assign/v2/test/utility/chain.cpp
==============================================================================
--- sandbox/statistics/support/libs/assign/v2/test/utility/chain.cpp (original)
+++ sandbox/statistics/support/libs/assign/v2/test/utility/chain.cpp 2011-01-13 00:33:06 EST (Thu, 13 Jan 2011)
@@ -20,10 +20,10 @@
namespace as2 = boost::assign::v2;
namespace ns = as2::checking::chain;
ns::twin_values::do_check<int>();
- ns::distinct_values::do_check<short>();
- ns::distinct_values::do_check<int>();
- ns::distinct_values::do_check<float>();
- ns::distinct_values::do_check<double>();
+ //ns::distinct_values::do_check<short>();
+ //ns::distinct_values::do_check<int>();
+ //ns::distinct_values::do_check<float>();
+ //ns::distinct_values::do_check<double>();
}
}// xxx_chain
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