|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r70266 - sandbox/assign_v2/libs/assign/v2/test/modifier
From: erwann.rogard_at_[hidden]
Date: 2011-03-20 21:29:55
Author: e_r
Date: 2011-03-20 21:29:51 EDT (Sun, 20 Mar 2011)
New Revision: 70266
URL: http://svn.boost.org/trac/boost/changeset/70266
Log:
upd assign_v2
Added:
sandbox/assign_v2/libs/assign/v2/test/modifier/
sandbox/assign_v2/libs/assign/v2/test/modifier/deduce.cpp (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/modifier/deduce.h (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/modifier/iterate.cpp (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/modifier/iterate.h (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/modifier/lookup.cpp (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/modifier/lookup.h (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/modifier/repeat.cpp (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/modifier/repeat.h (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/modifier/standard.cpp (contents, props changed)
sandbox/assign_v2/libs/assign/v2/test/modifier/standard.h (contents, props changed)
Added: sandbox/assign_v2/libs/assign/v2/test/modifier/deduce.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/modifier/deduce.cpp 2011-03-20 21:29:51 EDT (Sun, 20 Mar 2011)
@@ -0,0 +1,83 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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/type_traits/is_same.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/value/modifier/deduce.hpp>
+#include <libs/assign/v2/test/value/modifier/deduce.h>
+
+namespace test_assign_v2{
+namespace xxx_value{
+namespace xxx_modifier{
+namespace xxx_deduce{
+
+ // --User may skip this file-- //
+ // It checks internal details. //
+ // --------------------------- //
+
+ void test()
+ {
+ using namespace boost;
+ namespace as2 = assign::v2;
+
+ {
+ typedef as2::modifier_tag::push_back answer_;
+ as2::value_aux::check_deduce<std::deque<int>, answer_>();
+ as2::value_aux::check_deduce<std::list<int>, answer_>();
+ as2::value_aux::check_deduce<std::vector<int>, answer_>();
+
+ as2::value_aux::check_deduce<boost::ptr_deque<int>, answer_>();
+ as2::value_aux::check_deduce<boost::ptr_list<int>, answer_>();
+ as2::value_aux::check_deduce<boost::ptr_vector<int>, answer_>();
+ }
+ {
+ typedef as2::modifier_tag::iterate<> answer_;
+ as2::value_aux::check_deduce<boost::array<int, 1>, answer_>();
+ as2::value_aux::check_deduce<boost::ptr_array<int, 1>, answer_>();
+ }
+ {
+ typedef as2::modifier_tag::push answer_;
+ as2::value_aux::check_deduce<std::queue<int>, answer_>();
+ as2::value_aux::check_deduce<std::stack<int>, answer_>();
+ }
+ {
+ typedef as2::modifier_tag::insert answer_;
+ as2::value_aux::check_deduce<std::set<int>, answer_>();
+ typedef std::string str_;
+ as2::value_aux::check_deduce<std::map<str_, int>, answer_>();
+ }
+ {
+ //[put_deduce_map
+ typedef std::map<std::string, int> C;
+ typedef as2::value_aux::deduce_modifier_tag<C>::type found_;
+ typedef as2::modifier_tag::insert answer_;
+ BOOST_MPL_ASSERT(( boost::is_same<found_, answer_> ));
+ //]
+ }
+ }
+
+
+}// xxx_deduce
+}// xxx_modifier
+}// xxx_value
+}// test_assign_v2
Added: sandbox/assign_v2/libs/assign/v2/test/modifier/deduce.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/modifier/deduce.h 2011-03-20 21:29:51 EDT (Sun, 20 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_VALUE_MODIFIER_DEDUCE_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_VALUE_MODIFIER_DEDUCE_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_value{
+namespace xxx_modifier{
+namespace xxx_deduce{
+
+ void test();
+
+}// xxx_deduce
+}// xxx_modifier
+}// xxx_value
+}// xxx_test_assign
+
+#endif // LIBS_ASSIGN_V2_TEST_VALUE_MODIFIER_DEDUCE_ER_2010_H
Added: sandbox/assign_v2/libs/assign/v2/test/modifier/iterate.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/modifier/iterate.cpp 2011-03-20 21:29:51 EDT (Sun, 20 Mar 2011)
@@ -0,0 +1,94 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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/assign/v2/detail/config/check.hpp>
+
+#include <boost/assign/v2/value/modifier/iterate.hpp>
+#include <boost/assign/v2/value/put.hpp>
+#include <boost/assign/v2/deque.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <boost/lambda/bind.hpp>
+#include <boost/lambda/construct.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/range/algorithm/equal.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/typeof/typeof.hpp>
+#include <libs/assign/v2/test/value/modifier/iterate.h>
+
+#include <iostream>
+
+namespace test_assign_v2{
+namespace xxx_value{
+namespace xxx_modifier{
+namespace xxx_iterate{
+
+ void test()
+ {
+ using namespace boost;
+ namespace as2 = assign::v2;
+ {
+ //[test_value_modifier_iterate_meta
+ typedef as2::value_aux::keyword_iterate keyword_;
+ typedef as2::modifier_tag::iterate_arg arg_;
+ typedef as2::value_aux::modulo_modifier<keyword_, arg_> modulo_;
+ typedef array<int, 4> cont_;
+ typedef as2::result_of::put<cont_>::type put_;
+ typedef as2::result_of::modulo_modifier<put_> meta1_;
+ typedef ::boost::mpl::apply2<meta1_, keyword_, arg_>::type result1_;
+ typedef as2::modifier_tag::iterate<arg_> tag1_;
+ typedef as2::value_aux::replace_modifier_tag<put_> meta2_;
+ typedef ::boost::mpl::apply1<meta2_, tag1_>::type result2_;
+ BOOST_MPL_ASSERT(( is_same<result1_, result2_> ));
+ //]
+ }
+ {
+ //[test_value_modifier_iterate_shifted
+ using namespace lambda;
+ typedef int T; array<T, 4> powers; powers[0] = 1; powers[1] = 10;
+ int index = 2; ( as2::put( powers ) % ( as2::_iterate = var( index )++ ) )( 100 )( 1000 );
+
+ BOOST_ASSIGN_V2_CHECK( range::equal( powers, as2::csv_deque( 1, 10, 100, 1000 ) ) );
+ //]
+ }
+ {
+ //[test_value_modifier_iterate_meta_deque
+ typedef as2::value_aux::keyword_iterate keyword_;
+ typedef as2::modifier_tag::iterate_arg arg_;
+ typedef as2::value_aux::modulo_modifier<keyword_, arg_> modulo_;
+ typedef as2::result_of::deque<int>::type put_;
+ typedef as2::result_of::modulo_modifier<put_> meta1_;
+ typedef ::boost::mpl::apply2<meta1_, keyword_, arg_>::type result1_;
+ typedef as2::modifier_tag::iterate<arg_> tag1_;
+ typedef as2::value_aux::replace_modifier_tag<put_> meta2_;
+ typedef ::boost::mpl::apply1<meta2_, tag1_>::type result2_;
+ BOOST_MPL_ASSERT(( is_same<result1_, result2_> ));
+ //]
+ }
+ {
+ //[test_value_modifier_iterate_shifted_deque
+ using namespace lambda;
+ as2::result_of::deque<int>::type missing_tail = as2::deque<int>( 1 )( 10 )( -1 )( -1 );
+ int index = 2;
+
+ BOOST_AUTO(
+ powers,
+ ( missing_tail % ( as2::_iterate = var( index )++ ) )( 100 )( 1000 )
+ );
+
+ BOOST_ASSIGN_V2_CHECK( range::equal( powers, as2::csv_deque( 1, 10, 100, 1000 ) ) );
+ //]
+ }
+ }
+
+}// xxx_iterate
+}// xxx_modifier
+}// xxx_value
+}// test_assign_v2
Added: sandbox/assign_v2/libs/assign/v2/test/modifier/iterate.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/modifier/iterate.h 2011-03-20 21:29:51 EDT (Sun, 20 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_VALUE_MODIFIER_ITERATE_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_VALUE_MODIFIER_ITERATE_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_value{
+namespace xxx_modifier{
+namespace xxx_iterate{
+
+ void test();
+
+}// xxx_iterate
+}// xxx_modifier
+}// xxx_value
+}// xxx_test_assign
+
+#endif // LIBS_ASSIGN_V2_TEST_VALUE_MODIFIER_ITERATE_ER_2010_H
Added: sandbox/assign_v2/libs/assign/v2/test/modifier/lookup.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/modifier/lookup.cpp 2011-03-20 21:29:51 EDT (Sun, 20 Mar 2011)
@@ -0,0 +1,99 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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/assign/v2/detail/config/check.hpp>
+
+#include <boost/assign/v2/fun.hpp>
+#include <boost/assign/v2/value/modifier/lookup.hpp>
+#include <boost/assign/v2/value/put.hpp>
+#include <boost/assign/v2/deque.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/typeof/typeof.hpp>
+#include <boost/tuple/tuple.hpp>
+#include <libs/assign/v2/test/value/modifier/lookup.h>
+
+namespace test_assign_v2{
+namespace xxx_value{
+namespace xxx_modifier{
+namespace xxx_lookup{
+
+ void test()
+ {
+ using namespace boost;
+ namespace as2 = assign::v2;
+ {
+ //[test_value_modifier_lookup_meta
+ using namespace lambda;
+ typedef BOOST_TYPEOF(_1) arg_;
+ typedef as2::value_aux::keyword_lookup keyword_;
+ typedef as2::value_aux::modulo_modifier<keyword_, arg_> modulo_;
+ typedef std::map<std::string, int> cont_;
+ typedef as2::result_of::put<cont_>::type put_;
+ typedef as2::result_of::modulo_modifier<put_> meta1_;
+ typedef ::boost::mpl::apply2<meta1_, keyword_, arg_>::type result1_;
+ typedef as2::modifier_tag::lookup<arg_> tag1_;
+ typedef as2::value_aux::replace_modifier_tag<put_> meta2_;
+ typedef ::boost::mpl::apply1<meta2_, tag1_>::type result2_;
+ BOOST_MPL_ASSERT((boost::is_same<result1_, result2_>));
+ //]
+ }
+ {
+ //[test_value_modifier_lookup_map
+ using namespace lambda;
+ typedef std::string str_; typedef std::map<str_, int> C; C year;
+ (
+ as2::put( year )( "feb", 28 )( "apr", 30 )( "jun", 30 )( "sep", 30 )( "nov", 30 )
+ % ( as2::_fun = _1 ) % ( as2::_lookup = ( _1 = 31 ) )
+ )/*<<Calls `year["jan"] = 31` etc.>>*/( "jan" )( "mar" )( "may" )( "jul" )( "aug" )( "oct" )( "dec" );
+
+ BOOST_ASSIGN_V2_CHECK( year["jan"] == 31 );
+ BOOST_ASSIGN_V2_CHECK( year["dec"] == 31 );
+ //]
+ }
+ {
+ //[test_value_modifier_lookup_meta_deque
+ using namespace lambda;
+ typedef BOOST_TYPEOF(_1) arg_;
+ typedef as2::value_aux::keyword_lookup keyword_;
+ typedef as2::value_aux::modulo_modifier<keyword_, arg_> modulo_;
+ typedef as2::result_of::deque<int>::type put_;
+ typedef as2::result_of::modulo_modifier<put_> meta1_;
+ typedef ::boost::mpl::apply2<meta1_, keyword_, arg_>::type result1_;
+ typedef as2::modifier_tag::lookup<arg_> tag1_;
+ typedef as2::value_aux::replace_modifier_tag<put_> meta2_;
+ typedef ::boost::mpl::apply1<meta2_, tag1_>::type result2_;
+ BOOST_MPL_ASSERT((boost::is_same<result1_, result2_>));
+ //]
+ }
+ {
+ //[test_value_modifier_lookup_map_deque
+ using namespace lambda;
+ BOOST_AUTO(
+ days_in_first_quater,
+ (
+ as2::deque<int>( 31 )( 31 )( 31 ) % ( as2::_lookup = ( _1 -= 3 ) )
+ )( 1 )
+ );
+ BOOST_ASSIGN_V2_CHECK( days_in_first_quater[0] == 31 );
+ BOOST_ASSIGN_V2_CHECK( days_in_first_quater[1] == 28 );
+ BOOST_ASSIGN_V2_CHECK( days_in_first_quater[2] == 31 );
+ //]
+ }
+ }
+
+}// xxx_lookup
+}// xxx_modifier
+}// xxx_value
+}// test_assign_v2
Added: sandbox/assign_v2/libs/assign/v2/test/modifier/lookup.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/modifier/lookup.h 2011-03-20 21:29:51 EDT (Sun, 20 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_VALUE_MODIFIER_LOOKUP_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_VALUE_MODIFIER_LOOKUP_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_value{
+namespace xxx_modifier{
+namespace xxx_lookup{
+
+ void test();
+
+}// xxx_lookup
+}// xxx_modifier
+}// xxx_value
+}// xxx_test_assign
+
+#endif // LIBS_ASSIGN_V2_TEST_VALUE_MODIFIER_LOOKUP_ER_2010_H
Added: sandbox/assign_v2/libs/assign/v2/test/modifier/repeat.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/modifier/repeat.cpp 2011-03-20 21:29:51 EDT (Sun, 20 Mar 2011)
@@ -0,0 +1,54 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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/value/modifier/push_front.hpp>
+#include <boost/assign/v2/value/modifier/repeat.hpp>
+#include <boost/assign/v2/value/put.hpp>
+#include <boost/assign/v2/deque.hpp>
+#include <boost/range/algorithm/equal.hpp>
+#include <libs/assign/v2/test/value/modifier/repeat.h>
+
+namespace test_assign_v2{
+namespace xxx_value{
+namespace xxx_modifier{
+namespace xxx_repeat{
+
+ void test()
+ {
+ using namespace boost;
+ namespace as2 = assign::v2;
+ {
+ //[test_value_modifier_repeat_simple
+ std::vector<int> cont;
+ ( as2::put( cont ) % ( as2::_repeat = 2 ) )( 72 )( 31 )( 48 );
+
+ BOOST_ASSIGN_V2_CHECK( range::equal( cont, as2::csv_deque( 72, 72, 31, 31, 48, 48 ) ) );
+ //]
+ }
+ {
+ //[test_value_modifier_repeat_compose
+ BOOST_AUTO(
+ cont, (
+ as2::deque<int>( as2::_nil ) % as2::_push_front % ( as2::_repeat = 2 )
+ )( 72 )( 31 )( 48 )
+ );
+
+ BOOST_ASSIGN_V2_CHECK( range::equal( cont, as2::csv_deque( 48, 48, 31, 31, 72, 72 ) ) );
+ //]
+ }
+ }
+
+
+}// xxx_repeat
+}// xxx_modifier
+}// xxx_value
+}// test_assign_v2
Added: sandbox/assign_v2/libs/assign/v2/test/modifier/repeat.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/modifier/repeat.h 2011-03-20 21:29:51 EDT (Sun, 20 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_VALUE_MODIFIER_REPEAT_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_VALUE_MODIFIER_REPEAT_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_value{
+namespace xxx_modifier{
+namespace xxx_repeat{
+
+ void test();
+
+}// xxx_repeat
+}// xxx_modifier
+}// xxx_value
+}// xxx_test_assign
+
+#endif // LIBS_ASSIGN_V2_TEST_VALUE_MODIFIER_REPEAT_ER_2010_H
Added: sandbox/assign_v2/libs/assign/v2/test/modifier/standard.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/modifier/standard.cpp 2011-03-20 21:29:51 EDT (Sun, 20 Mar 2011)
@@ -0,0 +1,124 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 <string>
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/value/modifier/standard.hpp>
+#include <boost/assign/v2/value/put.hpp>
+#include <boost/assign/v2/deque.hpp>
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+#include <boost/range/algorithm/equal.hpp>
+#include <boost/range/algorithm/lower_bound.hpp>
+#include <boost/range/algorithm/upper_bound.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <boost/mpl/apply.hpp>
+#include <boost/mpl/assert.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/typeof/typeof.hpp>
+#include <libs/assign/v2/test/value/modifier/standard.h>
+
+namespace test_assign_v2{
+namespace xxx_value{
+namespace xxx_modifier{
+namespace xxx_standard{
+
+ void test()
+ {
+ using namespace boost;
+ namespace as2 = assign::v2;
+
+ // ------------------------------ WARNING ---------------------------- //
+ // Don't misconstrue the commands in the tests below as *necessary* to //
+ // obtain particular implementation. In most cases, the default is //
+ // already set at that invoked with operator% //
+ // ------------------------------------------------------------------- //
+
+ // PUT
+ {
+ //[test_value_modifier_standard_meta
+ typedef as2::result_of::put<std::vector<int> >::type put_;
+ typedef as2::value_aux::keyword_standard_modifier keyword_;
+ typedef as2::modifier_tag::push_front tag_;
+ typedef as2::result_of::modulo_modifier<put_> meta1_;
+ typedef ::boost::mpl::apply2<meta1_, keyword_, tag_>::type result1_;
+ typedef as2::value_aux::replace_modifier_tag<put_> meta2_;
+ typedef ::boost::mpl::apply1<meta2_, tag_>::type result2_;
+ BOOST_MPL_ASSERT(( boost::is_same<result1_, result2_> ));
+ //]
+ }
+ {
+ // fully qual boost::begin/end demanded by MSVC - error C2668
+ //[test_value_modifier_push_front
+ std::deque<double> sqrt2;
+ ( as2::put( sqrt2 ) % as2::_push_front )( 1.41421 )( 1.4142 )( 1.414 )( 1.41 );
+
+
+ BOOST_ASSIGN_V2_CHECK( boost::lower_bound( sqrt2, 1.41 ) == boost::begin( sqrt2 ) );
+ BOOST_ASSIGN_V2_CHECK( boost::upper_bound( sqrt2, 1.41421 ) == boost::end( sqrt2 ) );
+ //]
+ }
+ {
+ //[test_value_modifier_push
+ std::queue<int> fifo; ( as2::put( fifo ) % as2::_push )( 72 )( 31 )( 48 );
+
+ BOOST_ASSIGN_V2_CHECK( fifo.front() == 72 );
+ BOOST_ASSIGN_V2_CHECK( fifo.back() == 48 );
+ //]
+ }
+ {
+ //[test_value_modifier_insert
+ std::set<std::string> letters; ( as2::put( letters ) % as2::_insert )( "d" )( "a" )( "c" )( "b" );
+
+ BOOST_ASSIGN_V2_CHECK( letters.lower_bound( "a" ) == boost::begin( letters ) );
+ BOOST_ASSIGN_V2_CHECK( letters.upper_bound( "d" ) == boost::end( letters ) );
+ //]
+ }
+ {
+ //[test_value_modifier_push_back
+ std::list<int> list;
+ ( as2::put( list ) % as2::_push_back )( 72 )( 31 )( 48 );
+
+ BOOST_ASSIGN_V2_CHECK( range::equal( list, as2::csv_deque( 72, 31, 48 ) ) );
+ //]
+ }
+ // DEQUE
+ {
+ //[test_value_modifier_meta_deque
+ typedef as2::result_of::deque<int>::type put_;
+ typedef as2::value_aux::keyword_standard_modifier keyword_;
+ typedef as2::modifier_tag::push_front tag_;
+ typedef as2::result_of::modulo_modifier<put_> meta1_;
+ typedef ::boost::mpl::apply2<meta1_, keyword_, tag_>::type result1_;
+ typedef as2::value_aux::replace_modifier_tag<put_> meta2_;
+ typedef ::boost::mpl::apply1<meta2_, tag_>::type result2_;
+
+ BOOST_MPL_ASSERT(( boost::is_same<result1_, result2_> ));
+ //]
+ }
+ {
+ //[test_value_modifier_push_front_deque
+ BOOST_AUTO(
+ powers,
+ ( as2::deque<int>( as2::_nil ) % as2::_push_front )( 16 )( 8 )( 4 )( 2 )( 1 )
+ );
+
+ BOOST_ASSIGN_V2_CHECK( range::equal( powers, as2::csv_deque( 1, 2, 4, 8, 16 ) ) );
+ //]
+ }
+ }
+
+}// xxx_standard
+}// xxx_modifier
+}// xxx_value
+}// test_assign_v2
Added: sandbox/assign_v2/libs/assign/v2/test/modifier/standard.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/modifier/standard.h 2011-03-20 21:29:51 EDT (Sun, 20 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_VALUE_MODIFIER_STANDARD_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_VALUE_MODIFIER_STANDARD_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_value{
+namespace xxx_modifier{
+namespace xxx_standard{
+
+ void test();
+
+}// xxx_standard
+}// xxx_modifier
+}// xxx_value
+}// xxx_test_assign
+
+#endif // LIBS_ASSIGN_V2_TEST_VALUE_MODIFIER_STANDARD_ER_2010_H
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