Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69662 - in sandbox/assign_v2/libs/assign/v2/test/put: . pipe pipe/functor pipe/modifier
From: erwann.rogard_at_[hidden]
Date: 2011-03-07 20:44:34


Author: e_r
Date: 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
New Revision: 69662
URL: http://svn.boost.org/trac/boost/changeset/69662

Log:
upd assign_v2
Added:
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/operator.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/operator.h (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier.h (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/iterate.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/iterate.h (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/lookup.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/lookup.h (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/repeat.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/repeat.h (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/standard.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/standard.h (contents, props changed)
Text files modified:
   sandbox/assign_v2/libs/assign/v2/test/put/ptr.cpp | 48 +++++++++++++++++++++------------------
   1 files changed, 26 insertions(+), 22 deletions(-)

Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/operator.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/operator.cpp 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,120 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 <map>
+#include <deque>
+#include <vector>
+#include <list>
+#include <string>
+#include <boost/array.hpp>
+#include <boost/tuple/tuple.hpp>
+#include <boost/numeric/conversion/bounds.hpp>
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/put/pipe/functor.hpp>
+#include <boost/assign/v2/put/pipe/csv.hpp>
+
+#include <libs/assign/v2/test/put/pipe/functor/operator.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_operator{
+
+ void test(){
+ namespace as2 = boost::assign::v2;
+ {
+ //pipe_str_literal
+ typedef const char* T;
+ std::deque<T> cont; typedef std::string str_;
+ BOOST_ASSIGN_V2_CHECK( str_(
+ ( cont | as2::_put( "x" )( "y" )( "z" ) )[0]
+ ) == "x" );
+ BOOST_ASSIGN_V2_CHECK( str_( cont[1] ) == "y" );
+ BOOST_ASSIGN_V2_CHECK( str_( cont[2] ) == "z" );
+ }
+ {
+ //[pipe_array
+ const int sz = 3;
+ typedef boost::array<int, sz> r_;
+ boost::array<r_, sz> matrix3x3;
+
+ {
+ r_ r0, r1, r2;
+ int front = ( /*Calls [^r0[i] = j] for [^( i, j ) = ( 0, 1 ), ( 1, 2 ), ( 2, 3 ) ] and returns r0*/ r0 | as2::_put( 1 )( 2 )( 3 ) ).front();
+ int back = r0.back();
+ r2 | as2::_put( 7 )( 8 )( 9 );
+ r_ r = (
+ matrix3x3 | as2::_put
+ ( r0 )
+ ( /*<<`r1` modified on the fly>>*/r1 | as2::_put( 4 )( 5 )( 6 ) )
+ ( r2 )
+ )[1];
+
+ BOOST_ASSIGN_V2_CHECK( front == 1 );
+ BOOST_ASSIGN_V2_CHECK( back == 3 );
+ BOOST_ASSIGN_V2_CHECK( r == r1 );
+ }
+ for(int i = 0; i < 9; i++)
+ {
+ BOOST_ASSIGN_V2_CHECK( matrix3x3[ i / 3 ][ i % 3 ] == i + 1 );
+ }
+ //]
+ }
+ {
+ //[pipe_seq_var_args
+ typedef double elem_; typedef std::list<elem_> r_; typedef std::vector<r_> ragged_array_;
+ r_ a, b; elem_ front, back;
+ front = ( a | as2::_put( 0.71 )( 0.63 )( 0.85 ) ).front();
+ back = a.back();
+
+ ragged_array_ ragged_array;
+ r_ r = (
+ ragged_array | as2::_put
+ ( a )
+ ( /*<<`b` modified on the fly>>*/ b | as2::_put( 0.61 )( 0.69 )( 0.92 )( 0.55 ) )
+ ( 1, -99.99 )
+ ( )
+ )[2];
+
+ elem_ eps = boost::numeric::bounds<elem_>::smallest();
+
+ BOOST_ASSIGN_V2_CHECK( ragged_array[0].size() == a.size() );
+ BOOST_ASSIGN_V2_CHECK( ragged_array[1].size() == b.size() );
+ BOOST_ASSIGN_V2_CHECK( ragged_array[2].size() == 1 );
+ BOOST_ASSIGN_V2_CHECK( ragged_array[3].size() == 0 );
+
+ BOOST_ASSIGN_V2_CHECK( abs( front - 0.71 ) < eps );
+ BOOST_ASSIGN_V2_CHECK( abs( back - 0.85 ) < eps );
+ BOOST_ASSIGN_V2_CHECK( abs( r.front() + 99.0 ) < eps );
+ BOOST_ASSIGN_V2_CHECK( abs( r.back() + 99.0 ) < eps );
+ //]
+ }
+ {
+ using namespace boost;
+ //[pipe_seq_ref_tuple
+ typedef const char state_ [3]; state_ ct = "CT", nj = "NJ", ny = "NY";
+ typedef int code_; typedef boost::tuple<state_/*<<Notice the reference>>*/&, code_> area_code_;
+ std::deque< area_code_ > tri_state;
+ area_code_ front = (
+ tri_state | as2::_put( nj, 201 )( ct, 203 )( ny, 212 )( ny, 315 )( ny, 347 )( nj, 551 )
+ ).front();
+
+ BOOST_ASSIGN_V2_CHECK( get<0>( front ) == nj );
+ BOOST_ASSIGN_V2_CHECK( get<0>( tri_state.back() ) == nj );
+ BOOST_ASSIGN_V2_CHECK( get<1>( front ) == 201 );
+ BOOST_ASSIGN_V2_CHECK( get<1>( tri_state.back() ) == 551 );
+ //]
+ }
+
+ }// test()
+
+}// xxx_operator
+}// xxx_pipe
+}// xxx_put
+}// xxx_test_assign
\ No newline at end of file

Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/operator.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/operator.h 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,25 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_OPERATOR_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_PIPE_OPERATOR_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_operator{
+
+ void test();
+
+}// xxx_operator
+}// xxx_pipe
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier.cpp 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,32 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 <libs/assign/v2/test/put/pipe/modifier/iterate.h>
+#include <libs/assign/v2/test/put/pipe/modifier/lookup.h>
+#include <libs/assign/v2/test/put/pipe/modifier/repeat.h>
+#include <libs/assign/v2/test/put/pipe/modifier/standard.h>
+#include <libs/assign/v2/test/put/pipe/modifier.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_modifier{
+
+ void test()
+ {
+ xxx_iterate::test();
+ xxx_lookup::test();
+ xxx_repeat::test();
+ xxx_standard::test();
+ }
+
+}// xxx_modifier
+}// xxx_pipe
+}// xxx_put
+}// xxx_test_assign

Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier.h 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,25 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODIFIER_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_PIPE_MODIFIER_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_modifier{
+
+ void test();
+
+}// xxx_modifier
+}// xxx_pipe
+}// xxx_put
+}// test_assign_v2
+
+#endif

Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/iterate.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/iterate.cpp 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,50 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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/array.hpp>
+#include <boost/lambda/lambda.hpp>
+
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/put/modifier/iterate.hpp>
+#include <boost/assign/v2/put/pipe/functor.hpp>
+#include <libs/assign/v2/test/put/pipe/modifier/iterate.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_modifier{
+namespace xxx_iterate{
+
+ void test()
+ {
+ namespace as2 = boost::assign::v2;
+ namespace lambda = boost::lambda;
+ {
+
+ // TODO construct arg_ with phoenix and perhaps skip
+ //[iterate
+ typedef as2::functor_aux::post_increment<> arg_;
+ typedef int T; boost::array<T, 4> powers; powers[0] = 1; powers[1] = 10;
+ T front = (
+ powers | ( as2::_put % ( as2::_iterate = arg_( 2 ) ) )( 100 )( 1000 )
+ ).front();
+
+ BOOST_ASSIGN_V2_CHECK( front == 1 );
+ BOOST_ASSIGN_V2_CHECK( powers[1] == 10 );
+ BOOST_ASSIGN_V2_CHECK( powers[2] == 100 );
+ BOOST_ASSIGN_V2_CHECK( powers[3] == 1000 );
+ //]
+ }
+ }
+
+}// xxx_iterate
+}// xxx_modifier
+}// xxx_pipe
+}// xxx_put
+}// test_assign_v2

Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/iterate.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/iterate.h 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,27 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODIFIER_ITERATE_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_PIPE_MODIFIER_ITERATE_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_modifier{
+namespace xxx_iterate{
+
+ void test();
+
+}// xxx_iterate
+}// xxx_modifier
+}// xxx_pipe
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/lookup.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/lookup.cpp 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,57 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 <map>
+#include <string>
+#include <cmath>
+#include <boost/lambda/lambda.hpp>
+#include <boost/typeof/typeof.hpp>
+#include <boost/tuple/tuple.hpp>
+
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/detail/functor/identity.hpp>
+#include <boost/assign/v2/put/modulo/fun.hpp>
+#include <boost/assign/v2/put/modifier/lookup.hpp>
+#include <boost/assign/v2/put/pipe/functor.hpp>
+#include <libs/assign/v2/test/put/pipe/modifier/lookup.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_modifier{
+namespace xxx_lookup{
+
+ void test()
+ {
+ namespace as2 = boost::assign::v2;
+ namespace lambda = boost::lambda;
+ {
+ //[lookup
+ typedef std::map<std::string, int> C; C cal;
+ BOOST_AUTO( _id, ( as2::_fun = as2::_identity ) );
+ C::mapped_type n_mar = (
+ cal | as2::_put( "feb", 28 )
+ | ( /*Input is by default mapped to C::value_type but, here, we need C::key_type*/ as2::_put % /*Makes the input convertible to C::key_type*/_id % ( as2::_lookup = (lambda::_1 = 31) ) )( "jan" )( "mar" )( "may" )( "jul" )( "aug" )( "oct" )( "dec" )
+ | ( as2::_put % _id % ( as2::_lookup = (lambda::_1 = 30) ) )( "apr" )( "jun" )( "sep" )( "nov" )
+ )["mar"];
+
+ BOOST_ASSIGN_V2_CHECK( n_mar == 31 );
+ BOOST_ASSIGN_V2_CHECK( cal["jan"] == 31 );
+ BOOST_ASSIGN_V2_CHECK( cal["dec"] == 31 );
+ BOOST_ASSIGN_V2_CHECK( cal["apr"] == 30 );
+ BOOST_ASSIGN_V2_CHECK( cal["nov"] == 30 );
+ //]
+ }
+ }
+
+}// xxx_lookup
+}// xxx_modifier
+}// xxx_pipe
+}// xxx_put
+}// test_assign_v2

Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/lookup.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/lookup.h 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,27 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODIFIER_LOOKUP_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_PIPE_MODIFIER_LOOKUP_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_modifier{
+namespace xxx_lookup{
+
+ void test();
+
+}// xxx_lookup
+}// xxx_modifier
+}// xxx_pipe
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/repeat.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/repeat.cpp 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,46 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 <vector>
+#include <boost/typeof/typeof.hpp>
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/put/modifier/repeat.hpp>
+#include <boost/assign/v2/put/pipe/functor.hpp>
+#include <libs/assign/v2/test/put/pipe/modifier/repeat.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_modifier{
+namespace xxx_repeat{
+
+ void test()
+ {
+
+ namespace as2 = boost::assign::v2;
+ {
+ //[repeat
+ std::vector<int> cont;
+ int front = (
+ cont | ( as2::_put % ( as2::_repeat = 2 ) )( 72 )( 31 )( 48 )
+ ).front();
+
+ BOOST_ASSIGN_V2_CHECK( cont.size() == 6 );
+ BOOST_ASSIGN_V2_CHECK( front == 72 );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == 48 );
+ //]
+ }
+ }
+
+
+}// xxx_repeat
+}// xxx_modifier
+}// xxx_pipe
+}// xxx_put
+}// test_assign_v2

Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/repeat.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/repeat.h 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,27 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODIFIER_REPEAT_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_PIPE_MODIFIER_REPEAT_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_modifier{
+namespace xxx_repeat{
+
+ void test();
+
+}// xxx_repeat
+}// xxx_pipe
+}// xxx_modifier
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/standard.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/standard.cpp 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,75 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 <queue>
+#include <set>
+#include <stack>
+#include <string>
+#include <boost/range/begin.hpp>
+#include <boost/range/iterator.hpp>
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/put/modifier/standard.hpp>
+#include <boost/assign/v2/put/pipe/functor.hpp>
+#include <boost/assign/v2/put/deque.hpp>
+#include <libs/assign/v2/test/put/pipe/modifier/standard.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_modifier{
+namespace xxx_standard{
+
+ void test()
+ {
+ namespace as2 = boost::assign::v2;
+
+ // ------------------------------ WARNING ---------------------------- //
+ // Don't misconstrue the commands in the tests below as *necessary* to //
+ // obtain particular implementation. Most of the time the default is //
+ // already set at that invoked with operator% //
+ // ------------------------------------------------------------------- //
+
+ {
+ //[pipe_modifier_push_front
+ std::deque<int> powers;
+ powers | ( as2::_put % as2::_push_front )( 16 )( 8 )( 4 )( 2 )( 1 );
+
+ BOOST_ASSIGN_V2_CHECK( powers[0] == 1 );
+ BOOST_ASSIGN_V2_CHECK( powers[4] == 16 );
+ //]
+ }
+ {
+ //[pipe_modifier_push
+ typedef int int_; std::queue<int_> fifo;
+ int_ front = ( fifo | ( as2::_put % as2::_push )( 72 )( 31 )( 48 ) ).front();
+
+ BOOST_ASSIGN_V2_CHECK( front == 72 );
+ BOOST_ASSIGN_V2_CHECK( fifo.back() == 48 );
+ //]
+ }
+ {
+ //[pipe_modifier_insert
+ typedef std::set<double> doubles_; doubles_ sqrt2;
+ boost::range_iterator<doubles_>::type lower = (
+ sqrt2 | ( as2::_put % as2::_insert )( 1.414 )( 1.41421 )( 1.41 )( 1.4142 )
+ ).lower_bound( 1.41 );
+
+ BOOST_ASSIGN_V2_CHECK( lower == boost::begin( sqrt2 ) );
+ BOOST_ASSIGN_V2_CHECK( sqrt2.upper_bound( 1.41421 ) == boost::end( sqrt2 ) );
+ //]
+ }
+ }
+
+}// xxx_standard
+}// xxx_modifier
+}// xxx_pipe
+}// xxx_put
+}// test_assign_v2
\ No newline at end of file

Added: sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/standard.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/modifier/standard.h 2011-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -0,0 +1,27 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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_MODIFIER_STANDARD_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_PIPE_MODIFIER_STANDARD_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_pipe{
+namespace xxx_modifier{
+namespace xxx_standard{
+
+ void test();
+
+}// xxx_standard
+}// xxx_modifier
+}// xxx_pipe
+}// xxx_put
+}// xxx_test_assign
+
+#endif

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-03-07 20:44:31 EST (Mon, 07 Mar 2011)
@@ -7,6 +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 <string>
 #include <boost/ptr_container/ptr_array.hpp>
 #include <boost/ptr_container/ptr_deque.hpp>
@@ -16,7 +17,7 @@
 #include <boost/ptr_container/ptr_vector.hpp>
 #include <boost/assign/v2/detail/config/check.hpp>
 #include <boost/assign/v2/put/container/functor.hpp>
-
+*/
 #include <libs/assign/v2/test/put/ptr.h>
 
 namespace test_assign_v2{
@@ -24,6 +25,8 @@
 namespace xxx_ptr{
 
     void test(){
+// TODO
+/*
         namespace as2 = boost::assign::v2;
         {
             //[put_ptr_array
@@ -33,28 +36,7 @@
             BOOST_ASSIGN_V2_CHECK( cont[0] == x );
             BOOST_ASSIGN_V2_CHECK( cont[2] == z );
             //]
-
         }
-/*
- // These are not yet available (TODO)
- {
- //[put_ptr_map
- boost::ptr_map<std::string, int> assoc;
- as2::put( assoc )( "jan", 31 )( "feb", 28 )( "mar", 31 );
- BOOST_ASSIGN_V2_CHECK( assoc["feb"] == 28 );
- //]
- }
- {
- //[put_ptr_set
- 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 );
- //]
- }
-*/
         {
             //[put_ptr_deque
             typedef int T; T x = 1, y = 2, z = 0; boost::ptr_deque<T> cont;
@@ -79,7 +61,29 @@
             BOOST_ASSIGN_V2_CHECK( cont.back() == z );
             //]
         }
+*/
+
 
+/*
+ // These are not yet available (TODO)
+ {
+ //[put_ptr_map
+ boost::ptr_map<std::string, int> assoc;
+ as2::put( assoc )( "jan", 31 )( "feb", 28 )( "mar", 31 );
+ BOOST_ASSIGN_V2_CHECK( assoc["feb"] == 28 );
+ //]
+ }
+ {
+ //[put_ptr_set
+ 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 );
+ //]
+ }
+*/
     }// test
 
 }// xxx_ptr


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