|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r68497 - in sandbox/assign_v2/libs/assign/v2: example/put src test test/put test/put/pipe test/put/pipe/functor test/ref test/unit_testing
From: erwann.rogard_at_[hidden]
Date: 2011-01-27 18:23:30
Author: e_r
Date: 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
New Revision: 68497
URL: http://svn.boost.org/trac/boost/changeset/68497
Log:
upd assign_v2
Text files modified:
sandbox/assign_v2/libs/assign/v2/example/put/deque.cpp | 1
sandbox/assign_v2/libs/assign/v2/example/put/pipe.cpp | 2
sandbox/assign_v2/libs/assign/v2/src/main.cpp | 45 +++++----
sandbox/assign_v2/libs/assign/v2/test/put.cpp | 22 ++--
sandbox/assign_v2/libs/assign/v2/test/put/deque.cpp | 51 ++++-------
sandbox/assign_v2/libs/assign/v2/test/put/modulo.cpp | 45 ++++++---
sandbox/assign_v2/libs/assign/v2/test/put/pipe.cpp | 8 -
sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv.cpp | 61 -------------
sandbox/assign_v2/libs/assign/v2/test/put/pipe/ext.cpp | 6
sandbox/assign_v2/libs/assign/v2/test/put/pipe/forward_pars.cpp | 61 -------------
sandbox/assign_v2/libs/assign/v2/test/put/pipe/forward_pars.h | 26 -----
sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor.cpp | 2
sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/container.cpp | 177 +++++++++++++++++----------------------
sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/container.h | 5
sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/forward.cpp | 45 ++++-----
sandbox/assign_v2/libs/assign/v2/test/put/pipe/range.cpp | 63 ++++++-------
sandbox/assign_v2/libs/assign/v2/test/put/ptr.cpp | 118 ++++++++++++++------------
sandbox/assign_v2/libs/assign/v2/test/put/static.cpp | 67 --------------
sandbox/assign_v2/libs/assign/v2/test/put/static.h | 23 ----
sandbox/assign_v2/libs/assign/v2/test/put/stl.cpp | 151 ---------------------------------
sandbox/assign_v2/libs/assign/v2/test/put/stl.h | 24 -----
sandbox/assign_v2/libs/assign/v2/test/put/tuple_refs.cpp | 48 ----------
sandbox/assign_v2/libs/assign/v2/test/put/tuple_refs.h | 24 -----
sandbox/assign_v2/libs/assign/v2/test/ref.cpp | 4
sandbox/assign_v2/libs/assign/v2/test/ref/fusion.cpp | 93 --------------------
sandbox/assign_v2/libs/assign/v2/test/ref/fusion.h | 24 -----
sandbox/assign_v2/libs/assign/v2/test/unit_testing/put.cpp | 44 ++++++---
sandbox/assign_v2/libs/assign/v2/test/unit_testing/ref.cpp | 4
28 files changed, 328 insertions(+), 916 deletions(-)
Modified: sandbox/assign_v2/libs/assign/v2/example/put/deque.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/example/put/deque.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/example/put/deque.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -10,6 +10,7 @@
#include <string>
#include <assert.h>
#include <boost/assign/v2/put/deque.hpp>
+#include <boost/assign/v2/put/std/push_front.hpp>
#include <libs/assign/v2/example/include.h>
#include <libs/assign/v2/example/foo.h>
#include <libs/assign/v2/example/put/deque.h>
Modified: sandbox/assign_v2/libs/assign/v2/example/put/pipe.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/example/put/pipe.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/example/put/pipe.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -131,7 +131,7 @@
}
{
//[lookup
- std::map<const char*,int> cont;
+ std::map<std::string, int> cont;
cont["x"] = -1; cont["y"] = 0; cont["z"] = 1;
cont | (
as2::_csv_put % ( as2::_lookup = ( bl::_1 +=2 ) )
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-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -1,45 +1,52 @@
-
+/*
// Example
-//#include <iostream>
-//#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 <iostream>
+#include <libs/assign/v2/example/utility.h>
+#include <libs/assign/v2/example/ref.h>
+#include <libs/assign/v2/example/put.h>
+*/
+
// Test
-//#include <libs/assign/v2/test/put.h>
-//#include <libs/assign/v2/test/ref.h>
-//#include <libs/assign/v2/test/utility.h>
+#include <libs/assign/v2/test/detail.h>
+#include <libs/assign/v2/test/ref.h>
+#include <libs/assign/v2/test/put.h>
+#include <libs/assign/v2/test/utility.h>
+#include <libs/assign/v2/test/other.h>
+
// Speed
-#include <fstream>
-#include <libs/assign/v2/speed/put_ref.h>
+//#include <fstream>
+//#include <libs/assign/v2/speed/put_ref.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_put::test();
- //xxx_ref::test();
+ using namespace test_assign_v2;
+ xxx_detail::test();
+ xxx_put::test();
+ xxx_ref::test();
+ xxx_utility::test();
+ xxx_other::test();
}
- {
/*
+ {
using namespace example_assign_v2;
-
+
xxx_ref::run(std::cout);
xxx_put::run(std::cout);
xxx_utility::run(std::cout);
-*/
}
{
using namespace speed_assign_v2;
std::ofstream ofs("results");
xxx_put_ref::run(ofs);
}
+*/
+
return 0;
}
Modified: sandbox/assign_v2/libs/assign/v2/test/put.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -7,13 +7,14 @@
// 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 <libs/assign/v2/test/put/container.h>
+#include <libs/assign/v2/test/put/deduce.h>
+#include <libs/assign/v2/test/put/deque.h>
+#include <libs/assign/v2/test/put/ext.h>
#include <libs/assign/v2/test/put/modulo.h>
+//#include <libs/assign/v2/test/put/pipe.h>
#include <libs/assign/v2/test/put/ptr.h>
-#include <libs/assign/v2/test/put/static.h>
-#include <libs/assign/v2/test/put/stl.h>
-#include <libs/assign/v2/test/put/tuple_refs.h>
-#include <libs/assign/v2/test/put/pipe.h>
-#include <libs/assign/v2/test/put/deque.h>
+#include <libs/assign/v2/test/put/std.h>
#include <libs/assign/v2/test/put.h>
namespace test_assign_v2{
@@ -21,13 +22,14 @@
void test(){
+ xxx_container::test();
+ xxx_deduce::test();
+ xxx_deque::test();
+ xxx_ext::test();
xxx_modulo::test();
xxx_ptr::test();
- xxx_static::test();
- xxx_stl::test();
- xxx_tuple_refs::test();
- xxx_deque::test();
- xxx_pipe::test();
+ //xxx_pipe::test();
+ xxx_std::test();
}
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-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -7,21 +7,9 @@
// 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 <deque>
-#include <list>
-#include <map>
-#include <queue>
-#include <set>
-#include <stack>
-#include <vector>
#include <string>
-#include <boost/array.hpp>
-#include <boost/typeof/typeof.hpp>
-#include <boost/assign/v2/detail/keyword.hpp>
-#include <boost/assign/v2/detail/checking/container.hpp>
-#include <boost/assign/v2/detail/checking/constants.hpp>
-
#include <boost/assign/v2/put/deque.hpp>
+#include <boost/assign/v2/detail/checking/check.hpp>
#include <libs/assign/v2/test/put/deque.h>
@@ -31,31 +19,30 @@
void test()
{
- using namespace boost::assign::v2;
- {
- // CSV
- using namespace checking::constants;
- using namespace checking::container;
- do_check( csv_deque( a, b, c, d, e, f, g, h ) );
- }
+ namespace as2 = boost::assign::v2;
{
- // Functor
- using namespace checking::constants;
- using namespace checking::container;
- do_check( deque<int>( a )( b )( c )( d )( e )( f )( g )( h ) );
+ //[csv_deque
+ typedef int T; T x = 1, y = 2, z = 0;
+ as2::result_of::deque<T>::type cont = as2::csv_deque( x, y, z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
+ //]
}
{
- // Operator%
- BOOST_AUTO(tmp, ( deque<int>( _nil ) % ( _repeat = 3 ) ) );
- tmp( 1 );
- BOOST_ASSIGN_V2_CHECK( boost::size( tmp ) == 3 );
- BOOST_ASSIGN_V2_CHECK( tmp.front() == 1 );
- BOOST_ASSIGN_V2_CHECK( tmp.back() == 1 );
+ //[deque
+ typedef int T; T x = 1, y = 2, z = 0;
+ as2::result_of::deque<T>::type cont = as2::deque<T>( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
+ //]
}
{
- // string literals
+ //[deque_str
typedef std::string str_;
- BOOST_ASSIGN_V2_CHECK( str_( csv_deque("x")[0] ) == "x");
+ BOOST_ASSIGN_V2_CHECK(
+ str_( as2::csv_deque( "x" )( "y" )( "z" )[1] ) == "y"
+ );
+ //]
}
}
Modified: sandbox/assign_v2/libs/assign/v2/test/put/modulo.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/modulo.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/modulo.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -7,11 +7,13 @@
// 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 <queue>
-#include <map>
-#include <boost/assign/v2/detail/checking/container.hpp>
-#include <boost/assign/v2/detail/checking/constants.hpp>
-#include <boost/assign/v2/put/sub.hpp>
+#include <vector>
+#include <deque>
+#include <boost/assign/v2/detail/checking/check.hpp>
+#include <boost/assign/v2/put/container.hpp>
+#include <boost/assign/v2/put/std/push_front.hpp>
+#include <boost/assign/v2/put/modulo/fun.hpp>
+#include <boost/lambda/lambda.hpp>
#include <libs/assign/v2/test/put/modulo.h>
namespace test_assign_v2{
@@ -20,17 +22,28 @@
void test()
{
- using namespace boost::assign::v2;
- using namespace checking::constants;
- namespace chk_cont = checking::container;
- { // Queue + Repeat
- typedef std::queue<int> cont_;
- cont_ cont;
- ( put( cont ) % ( _repeat = 3 ) )( -1 );
- BOOST_ASSIGN_V2_CHECK( cont.front() == -1); cont.pop();
- BOOST_ASSIGN_V2_CHECK( cont.front() == -1); cont.pop();
- BOOST_ASSIGN_V2_CHECK( cont.front() == -1); cont.pop();
- BOOST_ASSIGN_V2_CHECK( cont.empty() == true);
+ namespace as2 = boost::assign::v2;
+ namespace bl = boost::lambda;
+ {
+ //[modulo_fun
+ typedef int T; T x = 1, y = 2, z = 0;
+ std::vector<int> cont;
+ (
+ as2::put( cont ) % ( as2::_fun = ( bl::_1 + 1 ) )
+ )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == ( x + 1 ) );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == ( z + 1 ) );
+ //]
+ }
+ {
+ //[modulo_modifier
+ typedef int T; T x = 1, y = 2, z = 0;
+ std::deque<int> cont;
+ ( as2::put( cont ) % ( as2::_modifier
+ = as2::modifier_tag::push_front() ) )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == z );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == x );
+ //]
}
}
Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -7,10 +7,9 @@
// 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 <libs/assign/v2/test/put/pipe/csv.h>
-#include <libs/assign/v2/test/put/pipe/forward_pars.h>
+#include <libs/assign/v2/test/put/pipe/modulo.h>
#include <libs/assign/v2/test/put/pipe/functor.h>
-#include <libs/assign/v2/test/put/pipe/stl.h>
+#include <libs/assign/v2/test/put/pipe/csv.h>
#include <libs/assign/v2/test/put/pipe/range.h>
#include <libs/assign/v2/test/put/pipe/ext.h>
@@ -19,10 +18,9 @@
namespace xxx_pipe{
void test(){
+ xxx_modulo::test();
xxx_csv::test();
- xxx_forward_pars::test();
xxx_functor::test();
- xxx_stl::test();
xxx_range::test();
xxx_ext::test();
}
Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/csv.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -7,14 +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 <iostream>
-#include <boost/preprocessor/expr_if.hpp>
-#include <boost/mpl/int.hpp>
-#include <boost/typeof/typeof.hpp>
-#include <boost/assign/v2/detail/checking/check.hpp>
-#include <boost/assign/v2/detail/checking/constants.hpp>
-#include <boost/assign/v2/put/pipe/csv.hpp>
-
+#include <libs/assign/v2/test/put/pipe/csv/rhs.h>
#include <libs/assign/v2/test/put/pipe/csv.h>
namespace test_assign_v2{
@@ -23,60 +16,10 @@
namespace xxx_csv{
void test(){
- using namespace boost;
- using namespace boost::assign::v2;
- using namespace checking::constants;
-
- typedef boost::mpl::int_<0> zero_;
- using namespace boost::assign::v2;
- int a1, b1, c1, d1;//, e1, f1, g1, h1;
- using namespace checking::constants;
- {
- a1 = a; b1 = b; c1 = c; d1 = d;
- }
-
-#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) );
-
- {
- BOOST_AUTO(
- tmp,
- ( _csv_put( a1, b1, c1 ) )
- );
- MACRO2(0, a1)
- MACRO2(1, b1)
- MACRO2(2, c1)
- }
- {
- BOOST_AUTO(
- tmp,
- ( _csv_put( a1, b1, c ) )
- );
- MACRO2(0, a1)
- MACRO2(1, b1)
- MACRO2(2, c)
- }
-#define C -10
- {
- BOOST_AUTO(
- tmp,
- ( _csv_put( a1, b, C ) )
- );
- MACRO2(0, a1)
- MACRO2(1, b)
- MACRO3(2, C)
- }
-
-#undef C
-#undef MACRO1
-#undef MACRO2
-#undef MACRO3
-
+ xxx_rhs::test();
}
}// xxx_csv
}// xxx_pipe
}// xxx_put
}// xxx_test_assign
-
Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/ext.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/ext.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/ext.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -15,9 +15,9 @@
#include <boost/assign/v2/put/pipe.hpp>
#include <boost/assign/v2/detail/checking/check.hpp>
-#include <boost/assign/v2/put/modifier/ext/lookup.hpp>
-#include <boost/assign/v2/put/modifier/ext/repeat.hpp>
-#include <boost/assign/v2/put/modifier/ext/iterate.hpp>
+#include <boost/assign/v2/put/ext/lookup.hpp>
+#include <boost/assign/v2/put/ext/repeat.hpp>
+#include <boost/assign/v2/put/ext/iterate.hpp>
#include <libs/assign/v2/test/put/pipe/ext.h>
namespace test_assign_v2{
Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/forward_pars.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/forward_pars.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/forward_pars.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -1,60 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to the //
-// 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 <list>
-#include <boost/mpl/vector/vector10.hpp>
-#include <boost/assign/v2/detail/functor/identity.hpp>
-#include <boost/assign/v2/detail/checking/check.hpp>
-#include <boost/assign/v2/put/modifier/std/push_front.hpp>
-#include <boost/assign/v2/put/generic.hpp>
-#include <boost/assign/v2/put/sub.hpp>
-#include <boost/assign/v2/put/generic/new_fun.hpp>
-#include <boost/assign/v2/put/generic/new_modifier.hpp>
-#include <boost/assign/v2/put/pipe/functor.hpp>
-#include <boost/assign/v2/put/pipe/pars/forward.hpp>
-
-#include <libs/assign/v2/test/put/pipe/forward_pars.h>
-
-namespace test_assign_v2{
-namespace xxx_put{
-namespace xxx_pipe{
-namespace xxx_forward_pars{
-
- void test()
- {
- using namespace boost::assign::v2;
- typedef std::list<int> cont_;
- cont_ cont;
- typedef modifier_tag::push_front modifier_tag_;
- typedef functor_aux::identity identity_;
- typedef put_aux::new_fun<identity_> fun_;
- typedef put_aux::set_modifier<modifier_tag_> modifier_;
- typedef boost::mpl::vector2<
- fun_,
- modifier_
- > pars_;
- put_pipe_aux::forward_pars<pars_>(
- put( cont ),
- (
- _put % (
- _fun = _identity
- ) % ( _modifier = modifier_tag_() )
- ).pars()
- )( 1 )( 2 )( 3 );
- BOOST_ASSIGN_V2_CHECK( cont.size() == 3 );
- BOOST_ASSIGN_V2_CHECK( cont.front() == 3 ); cont.pop_front();
- BOOST_ASSIGN_V2_CHECK( cont.front() == 2 ); cont.pop_front();
- BOOST_ASSIGN_V2_CHECK( cont.front() == 1 ); cont.pop_front();
- }
-
-}// xxx_forward_pars
-}// xxx_pipe
-}// xxx_put
-}// xxx_test_assign
-
+// TODO remove file
\ No newline at end of file
Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/forward_pars.h
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/forward_pars.h (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/forward_pars.h 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -1,25 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to the //
-// Boost Software License, Version 1.0. (See accompanying file //
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
-//////////////////////////////////////////////////////////////////////////////
-#ifndef LIBS_ASSIGN_V2_TEST_PUT_PIPE_FORWARD_PARS_ER_2010_H
-#define LIBS_ASSIGN_V2_TEST_PUT_PIPE_FORWARD_PARS__ER_2010_H
-
-namespace test_assign_v2{
-namespace xxx_put{
-namespace xxx_pipe{
-namespace xxx_forward_pars{
-
- void test();
-
-}// xxx_forward_pars
-}// xxx_pipe
-}// xxx_put
-}// xxx_test_assign
-
-#endif
+// TODO remove file
\ No newline at end of file
Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -9,6 +9,7 @@
//////////////////////////////////////////////////////////////////////////////
#include <libs/assign/v2/test/put/pipe/functor/container.h>
#include <libs/assign/v2/test/put/pipe/functor/forward.h>
+#include <libs/assign/v2/test/put/pipe/functor/rhs.h>
#include <libs/assign/v2/test/put/pipe/functor.h>
namespace test_assign_v2{
@@ -19,6 +20,7 @@
void test(){
xxx_container::test();
xxx_forward::test();
+ xxx_rhs::test();
}
}// xxx_functor
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-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -7,13 +7,18 @@
// 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/array.hpp>
+#include <deque>
+#include <list>
+#include <map>
+#include <queue>
+#include <set>
+#include <stack>
+#include <vector>
#include <string>
-#include <boost/mpl/int.hpp>
-#include <boost/typeof/typeof.hpp>
#include <boost/assign/v2/detail/checking/check.hpp>
-#include <boost/assign/v2/detail/checking/constants.hpp>
-#include <boost/assign/v2/put/modifier/ext/repeat.hpp>
#include <boost/assign/v2/put/pipe/functor.hpp>
+
#include <libs/assign/v2/test/put/pipe/functor/container.h>
namespace test_assign_v2{
@@ -22,114 +27,84 @@
namespace xxx_functor{
namespace xxx_container{
- struct val_pred{
-
- val_pred(){}
- template<typename T, typename U>
- void operator()(T const& t, U const& u)const
+ void test(){
+ namespace as2 = boost::assign::v2;
+ {
+ //[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_ASSIGN_V2_CHECK( t == u );
+ //[pipe_map
+ std::map<std::string, int> assoc;
+ assoc | as2::_put( "jan", 31 )( "feb", 28 )( "mar", 31 );
+ BOOST_ASSIGN_V2_CHECK( assoc["feb"] == 28 );
+ //]
}
- };
-
- struct ref_pred{
-
- ref_pred(){}
- template<typename T, typename U>
- void operator()(T const& t, U const& u)const
+ {
+ //[pipe_set
+ typedef std::string T;
+ std::set<T> assoc;
+ T x = "isomer", y = "ephemeral", z = "prosaic";
+ assoc | as2::_put( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( assoc.count( x ) == 1 );
+ BOOST_ASSIGN_V2_CHECK( assoc.count( z ) == 1 );
+ //]
+ }
{
- BOOST_ASSIGN_V2_CHECK( &t == &u );
+ //[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 );
+ //]
}
- };
-
- template<int i, int j, typename T, typename P, typename U>
- void local_assert(T& tmp, P const& pred, U const& u)
- {
-
- using namespace boost; // tuple<> (cpp03)
- using namespace boost::assign::v2; // tuple (cpp0x)
- pred(
- get<j>(
- tmp.seq_args().get( boost::mpl::int_<i>() )
- ),
- u
- );
- }
-
- void test()
- {
-
- using namespace boost;
- using namespace boost::assign::v2;
- using namespace checking::constants;
-
- typedef boost::mpl::int_<0> zero_;
{
- typedef put_pipe_aux::container<> container_;
- int x = -1;
- BOOST_AUTO(
- tmp,
- ( ( container_() % ( _repeat = 3 ) )( x ) )
- );
- int n = tmp
- .pars()
- .static_lookup( zero_() ).get();
- BOOST_ASSIGN_V2_CHECK( n == 3 );
+ //[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 );
+ //]
}
{
- #define A -10
- #define B 10
- int a1, b1, c1;
- using namespace checking::constants;
- {
- a1 = a; b1 = b; c1 = c;
- }
-
- BOOST_AUTO(
- tmp,
- ( _put
- ( a1, b1 )( a1, b )( a1, B )
- ( a, b1 )( a, b )( a, B )
- ( A, b1 )( A, b )( A, B )
- ( a1 )
- ( a )
- ( A )
- ()
- )
- );
- local_assert<0, 0>( tmp, ref_pred(), a1);
- local_assert<0, 1>( tmp, ref_pred(), b1);
- local_assert<1, 0>( tmp, ref_pred(), a1); local_assert<1, 1>( tmp, ref_pred(), b);
- local_assert<2, 0>( tmp, ref_pred(), a1); local_assert<2, 1>( tmp, val_pred(), B);
-
- local_assert<3, 0>( tmp, ref_pred(), a ); local_assert<3, 1>( tmp, ref_pred(), b1);
- local_assert<4, 0>( tmp, ref_pred(), a ); local_assert<4, 1>( tmp, ref_pred(), b);
- local_assert<5, 0>( tmp, ref_pred(), a ); local_assert<5, 1>( tmp, val_pred(), B);
-
- local_assert<6, 0>( tmp, val_pred(), A); local_assert<6, 1>( tmp, ref_pred(), b1);
- local_assert<7, 0>( tmp, val_pred(), A); local_assert<7, 1>( tmp, ref_pred(), b);
- local_assert<8, 0>( tmp, val_pred(), A); local_assert<8, 1>( tmp, val_pred(), B);
-
- local_assert<9, 0>( tmp, ref_pred(), a1);
- local_assert<10, 0>( tmp, ref_pred(), a);
- local_assert<11, 0>( tmp, val_pred(), A);
-
-#undef A
-#undef B
+ //[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 );
+ //]
}
{
- BOOST_AUTO(tmp, _put( "x" ) );
- typedef boost::mpl::int_<0> int_;
- typedef std::string str_;
- BOOST_ASSIGN_V2_CHECK(
- str_( get<0>( tmp.seq_args().get( int_() ) ) ) == "x"
- );
+ //[pipe_queue
+ typedef int T; T x = 8, y = 7, z = 6;
+ std::queue<T> fifo;
+ fifo | as2::_put( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( fifo.front() == x );
+ BOOST_ASSIGN_V2_CHECK( fifo.back() == z );
+ //]
}
- }
-
+ {
+ //[pipe_stack
+ typedef int T; T x = 8, y = 7, z = 4;
+ std::stack<T> lifo;
+ lifo | as2::_put( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( lifo.top() == z ); lifo.pop();
+ BOOST_ASSIGN_V2_CHECK( lifo.top() == y );
+ //]
+ }
+ }// test()
}// xxx_container
-}// xxx_functor
+}// xxx_functor
}// xxx_pipe
}// xxx_put
-}// test_assign_v2
+}// xxx_test_assign
Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/container.h
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/container.h (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/container.h 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -7,8 +7,6 @@
// Boost Software License, Version 1.0. (See accompanying file //
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
//////////////////////////////////////////////////////////////////////////////
-#ifndef LIBS_ASSIGN_V2_TEST_PUT_PIPE_FUNCTOR_CONTAINER_ER_2010_H
-#define LIBS_ASSIGN_V2_TEST_PUT_PIPE_FUNCTOR_CONTAINER_ER_2010_H
namespace test_assign_v2{
namespace xxx_put{
@@ -19,9 +17,8 @@
void test();
}// xxx_container
-}// xxx_functor
+}// xxx_functor
}// xxx_pipe
}// xxx_put
}// xxx_test_assign
-#endif
Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/forward.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/forward.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/forward.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -10,11 +10,9 @@
#include <deque>
#include <vector>
#include <string>
-#include <boost/typeof/typeof.hpp>
#include <boost/assign/v2/detail/checking/check.hpp>
-#include <boost/assign/v2/detail/checking/constants.hpp>
#include <boost/assign/v2/ref/list_tuple/container.hpp>
-#include <boost/assign/v2/put/sub.hpp>
+#include <boost/assign/v2/put/container/functor.hpp>
#include <boost/assign/v2/put/pipe/functor/forward.hpp>
#include <libs/assign/v2/test/put/pipe/functor/forward.h>
@@ -26,31 +24,26 @@
void test()
{
-
- using namespace boost::assign::v2;
- int a1, b1, c1, d1;//, e1, f1, g1, h1;
- {
- using namespace checking::constants;
- a1 = a; b1 = b; c1 = c; d1 = d;
- }
- using namespace put_pipe_aux;
+ namespace as2 = boost::assign::v2;
+ namespace ppx = as2::put_pipe_aux;
{
- std::vector<int> cont;
- BOOST_AUTO( lhs, ( put( cont ) ) );
- forward(
- lhs,
- ref::list_tuple( a1 )( b1 )( c1 )( d1 )()
- );
- BOOST_ASSIGN_V2_CHECK( cont[0] == a1 );
- BOOST_ASSIGN_V2_CHECK( cont[1] == b1 );
- BOOST_ASSIGN_V2_CHECK( cont[2] == c1 );
- BOOST_ASSIGN_V2_CHECK( cont[3] == d1 );
- BOOST_ASSIGN_V2_CHECK( cont.size() == 5 );
+ typedef int T;
+ T x = 1, y = 2, z = 0;
+ typedef std::vector<T> cont_; cont_ cont;
+ typedef as2::result_of::put<cont_>::type adapter_;
+ adapter_ adapter = as2::put( cont );
+ ppx::forward( adapter, as2::ref::list_tuple( x )( y )( z )() );
+ BOOST_ASSIGN_V2_CHECK( cont[0] == x );
+ BOOST_ASSIGN_V2_CHECK( cont[1] == y );
+ BOOST_ASSIGN_V2_CHECK( cont[2] == z );
+ BOOST_ASSIGN_V2_CHECK( cont.size() == 4 );
}
- {
- std::deque<const char*> cont;
- BOOST_AUTO( lhs, put( cont ) );
- forward( lhs, ref::list_tuple( "x" ) );
+ {
+ typedef const char* T;
+ typedef std::deque<T> cont_; cont_ cont;
+ typedef as2::result_of::put<cont_>::type adapter_;
+ adapter_ adapter = as2::put( cont );
+ ppx::forward( adapter, as2::ref::list_tuple( "x" ) );
typedef std::string str_;
BOOST_ASSIGN_V2_CHECK( str_( cont[0] ) == "x" );
}
Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/range.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/range.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/range.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -8,17 +8,10 @@
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
////////////////////////////////////////////////////////////////////////////
#include <deque>
-#include <list>
-#include <map>
-#include <queue>
-#include <set>
#include <stack>
#include <vector>
-#include <boost/type.hpp>
#include <boost/array.hpp>
-
-#include <boost/assign/v2/detail/checking/constants.hpp>
-#include <boost/assign/v2/detail/checking/container.hpp>
+#include <boost/assign/v2/detail/checking/check.hpp>
#include <boost/assign/v2/put/pipe/range.hpp>
#include <libs/assign/v2/test/put/pipe/range.h>
@@ -30,35 +23,39 @@
void test()
{
- std::vector<int> from;
namespace as2 = boost::assign::v2;
- {
- using namespace as2::checking::constants;
- from.push_back( a );
- from.push_back( b );
- from.push_back( c );
- from.push_back( d );
- from.push_back( e );
- from.push_back( f );
- from.push_back( g );
- from.push_back( h );
+
+ //[range_var
+ typedef int T; T x = 1, y = 2, z = 0;
+ std::vector<T> r( 3 ); r[0] = x; r[1] = y; r[2] = z;
+ //]
+
+ // Forwards to put()
+ {
+ //[range_array
+ boost::array<T, 3> cont; cont | as2::_put_range( r );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
+ //]
}
- {
- namespace ns = as2::checking::put_range;
- ns::do_check<boost::array<int,8> >( from );
- ns::do_check<std::deque<int> >( from );
- ns::do_check<std::list<int> >( from );
- ns::do_check<std::queue<int> >( from );
- ns::do_check<std::set<int> >( from );
- ns::do_check<std::stack<int> >( from );
- ns::do_check<std::vector<int> >( from );
+ {
+ //[range_stack
+ typedef std::stack<T> cont_;
+ BOOST_ASSIGN_V2_CHECK(
+ (
+ ::boost::type<cont_>() | as2::_put_range( r )
+ ).top() == x
+ );
+ //]
}
+
+ // Calls C(b, e)
{
- typedef std::stack<int> cont_;
- std::vector<int> v(2); v[0] = 1; v[1] = -99;
- assert(
- (boost::type<cont_>() | as2::_put_range( v ) ).top() == -99
- );
+ //[range_deque
+ std::deque<T> cont; cont | as2::_put_range( r );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == x );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == z );
+ //]
}
}
Modified: sandbox/assign_v2/libs/assign/v2/test/put/ptr.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/ptr.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/ptr.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -7,15 +7,16 @@
// 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/detail/workaround.hpp>
+#include <string>
#include <boost/ptr_container/ptr_array.hpp>
#include <boost/ptr_container/ptr_deque.hpp>
#include <boost/ptr_container/ptr_list.hpp>
+#include <boost/ptr_container/ptr_map.hpp>
+#include <boost/ptr_container/ptr_set.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/assign/v2/detail/checking/constants.hpp>
-#include <boost/assign/v2/detail/checking/container.hpp>
-#include <boost/assign/v2/put/sub.hpp>
+#include <boost/assign/v2/detail/checking/check.hpp>
+#include <boost/assign/v2/put/container.hpp>
#include <libs/assign/v2/test/put/ptr.h>
@@ -25,59 +26,64 @@
void test(){
namespace as2 = boost::assign::v2;
- { // Array
- {
- typedef boost::ptr_array<int, 8> cont_;
- cont_ cont;
- {
- using namespace as2:: checking::constants;
- namespace ns = as2::checking::container;
- ns::do_check(
- as2::csv_put( cont )
- ( a , b , c , d , e , f , g , h ).get()
- );
- }
- }
+ {
+ //[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 );
+ //]
+ }
+ {
+ //[map
+/* // TODO
+ boost::ptr_map<std::string, int> assoc;
+ as2::put( assoc )( "jan", 31 )( "feb", 28 )( "mar", 31 );
+ BOOST_ASSIGN_V2_CHECK( assoc["feb"] == 28 );
+*/
+ //]
+ }
+ {
+ //[set
+/* // TODO
+ typedef std::string T;
+ boost::ptr_set<T> assoc;
+ T x = "isomer", y = "ephemeral", z = "prosaic";
+ as2::put( assoc )( x )( y )( z );
+ BOOST_ASSIGN_V2_CHECK( assoc.count( x ) == 1 );
+ BOOST_ASSIGN_V2_CHECK( assoc.count( z ) == 1 );
+*/
+ //]
+ }
+ {
+ //[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 );
+ //]
+ }
+ {
+ //[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 );
+ //]
+ }
+ {
+ //[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 );
+ //]
}
- { // Sequence
-
- {
- typedef boost::ptr_deque<int> cont_;
- cont_ cont;
- {
- using namespace as2:: checking::constants;
- namespace ns = as2::checking::container;
- ns::do_check(
- as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).get()
- );
- }
- }// ptr_deque
- {
- typedef boost::ptr_list<int> cont_;
- cont_ cont;
- {
- using namespace as2:: checking::constants;
- namespace ns = as2::checking::container;
- ns::do_check(
- as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).get()
- );
- }
- }// ptr_list
- {
- typedef boost::ptr_vector<int> cont_;
- cont_ cont;
- {
- using namespace as2:: checking::constants;
- namespace ns = as2::checking::container;
- ns::do_check(
- as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).get()
- );
- }
- }// ptr_vector
- }// Sequence
}// test
}// xxx_ptr
Modified: sandbox/assign_v2/libs/assign/v2/test/put/static.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/static.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/static.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -1,66 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to the //
-// 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 <deque>
-#include <list>
-#include <map>
-#include <queue>
-#include <set>
-#include <stack>
-#include <vector>
-#include <string>
-#include <boost/array.hpp>
-
-#include <boost/ptr_container/ptr_array.hpp>
-#include <boost/ptr_container/ptr_deque.hpp>
-#include <boost/ptr_container/ptr_list.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/assign/v2/put/modifier.hpp>
-#include <libs/assign/v2/test/put/static.h>
-
-namespace test_assign_v2{
-namespace xxx_put{
-namespace xxx_static{
-
- void test()
- {
- namespace as2 = boost::assign::v2;
- {
- typedef as2::modifier_tag::push_back wanted_;
- as2::put_aux::check_deduce<std::deque<int>, wanted_>();
- as2::put_aux::check_deduce<std::list<int>, wanted_>();
- as2::put_aux::check_deduce<std::vector<int>, wanted_>();
-
- as2::put_aux::check_deduce<boost::ptr_deque<int>, wanted_>();
- as2::put_aux::check_deduce<boost::ptr_list<int>, wanted_>();
- as2::put_aux::check_deduce<boost::ptr_vector<int>, wanted_>();
- }
- {
- typedef as2::modifier_tag::iterate wanted_;
- as2::put_aux::check_deduce<boost::array<int, 1>, wanted_>();
- as2::put_aux::check_deduce<boost::ptr_array<int, 1>, wanted_>();
- }
- {
- typedef as2::modifier_tag::push wanted_;
- as2::put_aux::check_deduce<std::queue<int>, wanted_>();
- as2::put_aux::check_deduce<std::stack<int>, wanted_>();
- }
- {
- typedef as2::modifier_tag::insert wanted_;
- as2::put_aux::check_deduce<std::set<int>, wanted_>();
- typedef std::string str_;
- as2::put_aux::check_deduce<std::map<str_, int>, wanted_>();
- }
- }
-
-
-}// xxx_static
-}// xxx_put
-}// test_assign_v2
-
+// TODO remove file
Modified: sandbox/assign_v2/libs/assign/v2/test/put/static.h
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/static.h (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/static.h 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -1,23 +1,2 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to the //
-// Boost Software License, Version 1.0. (See accompanying file //
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
-//////////////////////////////////////////////////////////////////////////////
-#ifndef LIBS_ASSIGN_V2_TEST_PUT_STATIC_ER_2010_H
-#define LIBS_ASSIGN_V2_TEST_PUT_STATIC_ER_2010_H
+// TODO remove file
-namespace test_assign_v2{
-namespace xxx_put{
-namespace xxx_static{
-
- void test();
-
-}// xxx_static
-}// xxx_put
-}// xxx_test_assign
-
-#endif
Modified: sandbox/assign_v2/libs/assign/v2/test/put/stl.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/stl.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/stl.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -1,150 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to the //
-// 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/detail/workaround.hpp>
-
-#include <boost/array.hpp>
-#include <deque>
-#include <list>
-#include <map>
-#include <queue>
-#include <set>
-#include <stack>
-#include <vector>
-#include <boost/assign/v2/put/sub.hpp>
-#include <boost/assign/v2/detail/checking/constants.hpp>
-#include <boost/assign/v2/detail/checking/container.hpp>
-
-
-#include <libs/assign/v2/test/put/stl.h>
-
-namespace test_assign_v2{
-namespace xxx_put{
-namespace xxx_stl{
-
- void test(){
- namespace as2 = boost::assign::v2;
- { // Array
-
- {
- typedef boost::array<int,8> cont_;
- cont_ cont;
- {
- using namespace as2::checking::constants;
- as2::put( cont )( a )( b )( c )( d )( e )( f )( g )( h );
- }
- {
- namespace ns = as2::checking::container;
- ns::do_check( cont );
- }
- }
- }
- { // Associative
-
- {
- typedef std::map<int,int> cont_;
- cont_ cont;
- {
- namespace ns = as2::checking::container;
- using namespace as2::checking::constants;
- ns::do_check(
- as2::put( cont )
- ( a, a )( b, b )( c, c )
- ( d, d )( e, e )( f, f )
- ( g, g )( h, h ).get()
- );
- }
- }// map
- {
- typedef std::set<int> cont_;
- cont_ cont;
- {
- namespace ns = as2::checking::container;
- using namespace as2::checking::constants;
- ns::do_check(
- as2::put( cont )
- ( a )( b )( c )
- ( d )( e )( f )
- ( g )( h ).get()
- );
- }
- }// map
- }// Associative
- {
- // Sequence
- {
- typedef std::deque<int> cont_;
- cont_ cont;
- {
- using namespace as2::checking::constants;
- namespace ns = as2::checking::container;
- ns::do_check(
- as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).get()
- );
- }
- }// deque
- {
- typedef std::list<int> cont_;
- cont_ cont;
- {
- using namespace as2::checking::constants;
- namespace ns = as2::checking::container;
- ns::do_check(
- as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).get()
- );
- }
- }// list
- {
- typedef std::vector<int> cont_;
- cont_ cont;
- {
- using namespace as2::checking::constants;
- namespace ns = as2::checking::container;
- ns::do_check(
- as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).get()
- );
- }
- }// vector
- } // Sequence
- {
- // Push
- {
- typedef std::queue<int> cont_;
- cont_ cont;
- {
- using namespace as2::checking::constants;
- namespace ns = as2::checking::container;
- ns::do_check(
- as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).get()
- );
- }
- }// queue
- // Push
- {
- typedef std::stack<int> cont_;
- cont_ cont;
- {
- using namespace as2::checking::constants;
- namespace ns = as2::checking::container;
- ns::do_check(
- as2::put( cont )
- ( a )( b )( c )( d )( e )( f )( g )( h ).get()
- );
- }
- }// queue
- }// Push
- }// test()
-
-}// xxx_stl
-}// xxx_put
-}// xxx_test_assign
+// TODO remove file
Modified: sandbox/assign_v2/libs/assign/v2/test/put/stl.h
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/stl.h (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/stl.h 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -1,23 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to the //
-// Boost Software License, Version 1.0. (See accompanying file //
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
-//////////////////////////////////////////////////////////////////////////////
-#ifndef LIBS_ASSIGN_V2_TEST_PUT_STL_ER_2010_H
-#define LIBS_ASSIGN_V2_TEST_PUT_STL_ER_2010_H
-
-namespace test_assign_v2{
-namespace xxx_put{
-namespace xxx_stl{
-
- void test();
-
-}// xxx_stl
-}// xxx_put
-}// xxx_test_assign
-
-#endif
+// TODO remove file
Modified: sandbox/assign_v2/libs/assign/v2/test/put/tuple_refs.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/tuple_refs.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/tuple_refs.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -1,47 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to the //
-// 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 <deque>
-#include <boost/tuple/tuple.hpp>
-#include <boost/assign/v2/detail/checking/check.hpp>
-#include <boost/assign/v2/detail/checking/constants.hpp>
-#include <boost/assign/v2/put/sub.hpp>
-#include <libs/assign/v2/test/put/tuple_refs.h>
-
-namespace test_assign_v2{
-namespace xxx_put{
-namespace xxx_tuple_refs{
-
- void test()
- {
- namespace as2 = boost::assign::v2;
- using namespace as2::checking::constants;
- {
- int a1, b1, c1, d1;//, e1, f1, g1, h1;
- {
- a1 = a; b1 = b; c1 = c;
- d1 = d;
- }
- { // Deque + tuple
- typedef boost::tuple<int&, const int&> tuple_;
- typedef std::deque<tuple_> cont_;
- cont_ cont;
- as2::put( cont )( a1 , b1 )( c1 , d1 );
- BOOST_ASSIGN_V2_CHECK( &a1 == &boost::get<0>( cont[0] ) );
- BOOST_ASSIGN_V2_CHECK( &b1 == &boost::get<1>( cont[0] ) );
- BOOST_ASSIGN_V2_CHECK( &c1 == &boost::get<0>( cont[1] ) );
- BOOST_ASSIGN_V2_CHECK( &d1 == &boost::get<1>( cont[1] ) );
- }
- }
- }
-
-}// xxx_tuple_refs
-}// xxx_put
-}// test_assign_v2
-
+// TODO remove file
\ No newline at end of file
Modified: sandbox/assign_v2/libs/assign/v2/test/put/tuple_refs.h
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/tuple_refs.h (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/tuple_refs.h 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -1,23 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to the //
-// Boost Software License, Version 1.0. (See accompanying file //
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
-//////////////////////////////////////////////////////////////////////////////
-#ifndef LIBS_ASSIGN_V2_TEST_PUT_TUPLE_REFS_ER_2010_H
-#define LIBS_ASSIGN_V2_TEST_PUT_TUPLE_REFS_ER_2010_H
-
-namespace test_assign_v2{
-namespace xxx_put{
-namespace xxx_tuple_refs{
-
- void test();
-
-}// xxx_tuple_refs
-}// xxx_put
-}// xxx_test_assign
-
-#endif
+// TODO remove file
\ No newline at end of file
Modified: sandbox/assign_v2/libs/assign/v2/test/ref.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/ref.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/ref.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -10,7 +10,7 @@
#include <libs/assign/v2/test/ref/array.h>
#include <libs/assign/v2/test/ref/convert_traits.h>
#include <libs/assign/v2/test/ref/csv_array.h>
-#include <libs/assign/v2/test/ref/fusion.h>
+#include <libs/assign/v2/test/ref/list.h>
#include <libs/assign/v2/test/ref/list_tuple.h>
#include <libs/assign/v2/test/ref/wrapper.h>
#include <libs/assign/v2/test/ref.h>
@@ -23,7 +23,7 @@
xxx_array::test();
xxx_convert_traits::test();
xxx_csv_array::test();
- xxx_fusion::test();
+ xxx_list::test();
xxx_list_tuple::test();
xxx_wrapper::test();
Modified: sandbox/assign_v2/libs/assign/v2/test/ref/fusion.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/ref/fusion.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/ref/fusion.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -1,92 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to the //
-// 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/mpl/int.hpp>
-#include <boost/mpl/apply.hpp>
-#include <boost/mpl/vector/vector0.hpp>
-#include <boost/mpl/vector/vector10.hpp>
-#include <boost/array.hpp>
-#include <boost/assign/v2/detail/checking/check.hpp>
-#include <boost/assign/v2/ref/wrapper/copy.hpp>
-#include <boost/assign/v2/ref/fusion.hpp>
-#include <libs/assign/v2/test/ref/fusion.h>
-
-namespace test_assign_v2{
-namespace xxx_ref{
-namespace xxx_fusion{
-
- void test()
- {
- using namespace boost::assign::v2;
- using namespace ref;
- typedef assign_tag::copy tag1_;
- typedef boost::use_default tag2_;
- typedef boost::mpl::int_<0> i0_;
- typedef boost::mpl::int_<1> i1_;
- typedef boost::mpl::int_<2> i2_;
- {
- typedef int t0_;
- typedef int const t1_;
- typedef const char* t2_;
- t0_ a = 0;
-#define B 2
- t2_ c = "c";
-
- typedef nth_result_of::fusion<tag1_, tag2_> result_;
- typedef boost::mpl::apply1<result_,
- boost::mpl::vector<t0_,t1_,t2_>
- >::type ar_;
- ar_ ar = fusion<tag1_, tag2_>( _nil )( a )( B )( c );
- ar.static_lookup( i0_() );
- BOOST_ASSIGN_V2_CHECK( &ar.static_lookup( i0_() ) == &a );
- BOOST_ASSIGN_V2_CHECK( ar.static_lookup( i1_() ) == B );
- BOOST_ASSIGN_V2_CHECK( &ar.static_lookup( i2_() ) == &c );
- {
- typedef boost::mpl::apply1<result_,
- boost::mpl::vector<t0_,t1_>
- >::type ar2_;
- ar2_ ar2 = ar.pop();
- BOOST_ASSIGN_V2_CHECK( ar2.back() == B );
- typedef boost::mpl::apply1<result_,
- boost::mpl::vector<t0_>
- >::type ar1_;
- ar1_ ar1 = ar2.pop();
- BOOST_ASSIGN_V2_CHECK( &ar1.back() == &a );
- typedef boost::mpl::apply1<
- result_,
- boost::mpl::vector0<>
- >::type ar0_;
- ar0_ ar0 = ar1.pop();
- }
-#undef B
- }
- {
- typedef int t_;
- t_ a = 0;
- t_ b = 1;
- t_ c = 2;
- typedef wrapper<tag1_,t_> w_;
- typedef boost::array<w_,3> arw_;
- typedef nth_result_of::fusion<tag1_, tag2_> result_;
- typedef boost::mpl::apply1<result_,
- boost::mpl::vector<t_,t_,t_>
- >::type ar_;
- ar_ ar = fusion<tag1_, tag2_>( _nil )( a )( b )( c );
- arw_ arw;
- assign_array( arw, ar );
- BOOST_ASSIGN_V2_CHECK( &arw[ 0 ].get() == &a );
- BOOST_ASSIGN_V2_CHECK( &arw[ 1 ].get() == &b );
- BOOST_ASSIGN_V2_CHECK( &arw[ 2 ].get() == &c );
- }
- }
-
-}// xxx_fusion
-}// xxx_ref
-}// test_assign
-
+// TODO remove file
\ No newline at end of file
Modified: sandbox/assign_v2/libs/assign/v2/test/ref/fusion.h
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/ref/fusion.h (original)
+++ sandbox/assign_v2/libs/assign/v2/test/ref/fusion.h 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -1,23 +1 @@
-//////////////////////////////////////////////////////////////////////////////
-// Boost.Assign v2 //
-// //
-// Copyright (C) 2003-2004 Thorsten Ottosen //
-// Copyright (C) 2010 Erwann Rogard //
-// Use, modification and distribution are subject to the //
-// Boost Software License, Version 1.0. (See accompanying file //
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) //
-//////////////////////////////////////////////////////////////////////////////
-#ifndef BOOST_ASSIGN_V2_TEST_REF_FUSION_ER_2010_H
-#define BOOST_ASSIGN_V2_TEST_REF_FUSION_ER_2010_H
-
-namespace test_assign_v2{
-namespace xxx_ref{
-namespace xxx_fusion{
-
- void test();
-
-}// xxx_fusion
-}// xxx_ref
-}// test_assign
-
-#endif
+// TODO remove file
\ No newline at end of file
Modified: sandbox/assign_v2/libs/assign/v2/test/unit_testing/put.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/unit_testing/put.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/unit_testing/put.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -15,19 +15,26 @@
#include <boost/test/test_tools.hpp>
#define BOOST_ASSIGN_V2_CHECK( p ) BOOST_CHECK( p )
-#include <libs/assign/v2/test/put/static.cpp>
-#include <libs/assign/v2/test/put/stl.cpp>
-#include <libs/assign/v2/test/put/tuple_refs.cpp>
-#include <libs/assign/v2/test/put/deque.cpp>
+#include <libs/assign/v2/test/put/deduce.cpp>
#include <libs/assign/v2/test/put/modulo.cpp>
+#include <libs/assign/v2/test/put/container/functor.cpp>
+#include <libs/assign/v2/test/put/container/csv.cpp>
+#include <libs/assign/v2/test/put/container/range.cpp>
+#include <libs/assign/v2/test/put/std.cpp>
+#include <libs/assign/v2/test/put/ext.cpp>
#include <libs/assign/v2/test/put/ptr.cpp>
-#include <libs/assign/v2/test/put/pipe/forward_pars.cpp>
-#include <libs/assign/v2/test/put/pipe/functor/container.cpp>
+#include <libs/assign/v2/test/put/deque.cpp>
+
+#include <libs/assign/v2/test/put/pipe/modulo.cpp>
+#include <libs/assign/v2/test/put/pipe/functor/rhs.cpp>
#include <libs/assign/v2/test/put/pipe/functor/forward.cpp>
-#include <libs/assign/v2/test/put/pipe/csv.cpp>
+#include <libs/assign/v2/test/put/pipe/functor/container.cpp>
+#include <libs/assign/v2/test/put/pipe/csv/rhs.cpp>
+#include <libs/assign/v2/test/put/pipe/csv/container.cpp>
#include <libs/assign/v2/test/put/pipe/ext.cpp>
-#include <libs/assign/v2/test/put/pipe/stl.cpp>
#include <libs/assign/v2/test/put/pipe/range.cpp>
+
+
#include <boost/test/unit_test.hpp>
using boost::unit_test::test_suite;
test_suite* init_unit_test_suite( int argc, char* argv[] )
@@ -36,18 +43,23 @@
using namespace test_assign_v2;
{
namespace ns = xxx_put;
- test->add( BOOST_TEST_CASE( &ns::xxx_static::test ) );
- test->add( BOOST_TEST_CASE( &ns::xxx_stl::test ) );
- test->add( BOOST_TEST_CASE( &ns::xxx_tuple_refs::test ) );
- test->add( BOOST_TEST_CASE( &ns::xxx_deque::test ) );
+ test->add( BOOST_TEST_CASE( &ns::xxx_deduce::test ) );
test->add( BOOST_TEST_CASE( &ns::xxx_modulo::test ) );
+ test->add( BOOST_TEST_CASE( &ns::xxx_container::xxx_functor::test ) );
+ test->add( BOOST_TEST_CASE( &ns::xxx_container::xxx_csv::test ) );
+ test->add( BOOST_TEST_CASE( &ns::xxx_container::xxx_range::test ) );
+ test->add( BOOST_TEST_CASE( &ns::xxx_std::test ) );
+ test->add( BOOST_TEST_CASE( &ns::xxx_ext::test ) );
test->add( BOOST_TEST_CASE( &ns::xxx_ptr::test ) );
- test->add( BOOST_TEST_CASE( &ns::xxx_pipe::xxx_forward_pars::test ) );
- test->add( BOOST_TEST_CASE( &ns::xxx_pipe::xxx_functor::xxx_container::test ) );
+ test->add( BOOST_TEST_CASE( &ns::xxx_deque::test ) );
+
+ test->add( BOOST_TEST_CASE( &ns::xxx_pipe::xxx_modulo::test ) );
+ test->add( BOOST_TEST_CASE( &ns::xxx_pipe::xxx_functor::xxx_rhs::test ) );
test->add( BOOST_TEST_CASE( &ns::xxx_pipe::xxx_functor::xxx_forward::test ) );
- test->add( BOOST_TEST_CASE( &ns::xxx_pipe::xxx_csv::test ) );
+ test->add( BOOST_TEST_CASE( &ns::xxx_pipe::xxx_functor::xxx_container::test ) );
+ test->add( BOOST_TEST_CASE( &ns::xxx_pipe::xxx_csv::xxx_rhs::test ) );
+ test->add( BOOST_TEST_CASE( &ns::xxx_pipe::xxx_csv::xxx_container::test ) );
test->add( BOOST_TEST_CASE( &ns::xxx_pipe::xxx_ext::test ) );
- test->add( BOOST_TEST_CASE( &ns::xxx_pipe::xxx_stl::test ) );
test->add( BOOST_TEST_CASE( &ns::xxx_pipe::xxx_range::test ) );
}
return test;
Modified: sandbox/assign_v2/libs/assign/v2/test/unit_testing/ref.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/unit_testing/ref.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/unit_testing/ref.cpp 2011-01-27 18:23:17 EST (Thu, 27 Jan 2011)
@@ -16,7 +16,7 @@
#define BOOST_ASSIGN_V2_CHECK( p ) BOOST_CHECK( p )
#include <libs/assign/v2/test/ref/convert_traits.cpp>
#include <libs/assign/v2/test/ref/wrapper.cpp>
-#include <libs/assign/v2/test/ref/fusion.cpp>
+#include <libs/assign/v2/test/ref/list.cpp>
#include <libs/assign/v2/test/ref/list_tuple.cpp>
#include <libs/assign/v2/test/ref/array.cpp>
#include <libs/assign/v2/test/ref/csv_array.cpp>
@@ -31,7 +31,7 @@
using namespace xxx_ref;
test->add( BOOST_TEST_CASE( &xxx_convert_traits::test ) );
test->add( BOOST_TEST_CASE( &xxx_wrapper::test ) );
- test->add( BOOST_TEST_CASE( &xxx_fusion::test ) );
+ test->add( BOOST_TEST_CASE( &xxx_list::test ) );
test->add( BOOST_TEST_CASE( &xxx_list_tuple::test ) );
test->add( BOOST_TEST_CASE( &xxx_array::test ) );
test->add( BOOST_TEST_CASE( &xxx_csv_array::test ) );
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