Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69556 - sandbox/assign_v2/libs/assign/v2/test/put/modulo
From: erwann.rogard_at_[hidden]
Date: 2011-03-04 15:55:50


Author: e_r
Date: 2011-03-04 15:55:45 EST (Fri, 04 Mar 2011)
New Revision: 69556
URL: http://svn.boost.org/trac/boost/changeset/69556

Log:
upd assign_v2
Added:
   sandbox/assign_v2/libs/assign/v2/test/put/modulo/
   sandbox/assign_v2/libs/assign/v2/test/put/modulo/ext.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/modulo/ext.h (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/modulo/fun.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/modulo/fun.h (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/modulo/std.cpp (contents, props changed)
   sandbox/assign_v2/libs/assign/v2/test/put/modulo/std.h (contents, props changed)

Added: sandbox/assign_v2/libs/assign/v2/test/put/modulo/ext.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/modulo/ext.cpp 2011-03-04 15:55:45 EST (Fri, 04 Mar 2011)
@@ -0,0 +1,81 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 <map>
+#include <stack>
+#include <boost/typeof/typeof.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <boost/array.hpp>
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/put/ext.hpp>
+#include <boost/assign/v2/put/container/functor.hpp>
+#include <boost/assign/v2/put/deque/functor.hpp>
+#include <libs/assign/v2/test/put/ext.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_modulo{
+namespace xxx_ext{
+
+ void test()
+ {
+ namespace as2 = boost::assign::v2;
+ namespace lambda = boost::lambda;
+ {
+ //[put_ext_iterate
+ typedef int T; boost::array<T, 3> cont; cont[0] = -1;
+ ( as2::put( cont ) % ( as2::_iterate = 1 ) )( 0 )( 1 );
+
+ BOOST_ASSIGN_V2_CHECK( cont[0] == -1 );
+ BOOST_ASSIGN_V2_CHECK( cont[1] == 0 );
+ BOOST_ASSIGN_V2_CHECK( cont[2] == 1 );
+ //]
+ }
+ {
+ //[put_ext_lookup
+ std::map<std::string, int> cont;
+ cont["jan"] = 31; cont["feb"] = 29; cont["mar"] = 32;
+ (
+ as2::put( cont ) % ( as2::_lookup = ( lambda::_1 -= 1 ) )
+ )( "feb" )( "mar" );
+
+ BOOST_ASSIGN_V2_CHECK( cont["feb"] == 28 );
+ BOOST_ASSIGN_V2_CHECK( cont["mar"] == 31 );
+ //]
+ }
+ {
+ //[put_ext_repeat
+ std::vector<int> cont;
+ ( as2::put( cont ) % ( as2::_repeat = 2 ) )( -1 )( 0 )( 1 );
+
+ BOOST_ASSIGN_V2_CHECK( cont.size() == 6 );
+ BOOST_ASSIGN_V2_CHECK( cont.front() == -1 );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == 1 );
+ //]
+ }
+ {
+ //[put_deque_modulo_repeat
+ BOOST_AUTO(
+ cont, (
+ as2::deque<int>( as2::_nil ) % ( as2::_repeat = 2 )
+ )( -1 )( 0 )( 1 )
+ );
+ BOOST_ASSIGN_V2_CHECK( boost::size( cont ) == 6 );
+ //]
+ BOOST_ASSIGN_V2_CHECK( cont.front() == -1 );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == 1 );
+ }
+
+ }
+
+}// xxx_ext
+}// xxx_modulo
+}// xxx_put
+}// test_assign_v2

Added: sandbox/assign_v2/libs/assign/v2/test/put/modulo/ext.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/modulo/ext.h 2011-03-04 15:55:45 EST (Fri, 04 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_MODULO_EXT_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_MODULO_EXT_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_modulo{
+namespace xxx_ext{
+
+ void test();
+
+}// xxx_ext
+}// xxx_modulos
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/assign_v2/libs/assign/v2/test/put/modulo/fun.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/modulo/fun.cpp 2011-03-04 15:55:45 EST (Fri, 04 Mar 2011)
@@ -0,0 +1,61 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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 <deque>
+#include <boost/typeof/typeof.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/put/container.hpp>
+#include <boost/assign/v2/put/deque.hpp>
+#include <boost/assign/v2/put/modulo/fun.hpp>
+#include <libs/assign/v2/test/put/modulo.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_modulo{
+namespace xxx_fun{
+
+ void test()
+ {
+ namespace as2 = boost::assign::v2;
+ namespace lambda = boost::lambda;
+ {
+ //[put_cont_modulo_fun
+ typedef int T; T x = 1, y = 2, z = 0;
+ std::vector<int> cont;
+ (
+ as2::put( cont ) % ( as2::_fun = ( lambda::_1 + 1 ) )
+ )( x )( y )( z );
+
+ BOOST_ASSIGN_V2_CHECK( cont.front() == ( x + 1 ) );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == ( z + 1 ) );
+ //]
+ }
+ {
+ //[put_deque_modulo_fun
+ typedef int T; T x = 1, y = 2, z = 0;
+ BOOST_AUTO(
+ cont, (
+ as2::deque<T>( as2::_nil ) % (
+ as2::_fun = ( lambda::_1 + 1 )
+ )
+ )( x )( y )( z )
+ );
+
+ BOOST_ASSIGN_V2_CHECK( cont.front() == ( x + 1 ) );
+ BOOST_ASSIGN_V2_CHECK( cont.back() == ( z + 1 ) );
+ //]
+ }
+ }
+
+}// xxx_fun
+}// xxx_modulo
+}// xxx_put
+}// test_assign_v2

Added: sandbox/assign_v2/libs/assign/v2/test/put/modulo/fun.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/modulo/fun.h 2011-03-04 15:55:45 EST (Fri, 04 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_MODULO_FUN_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_MODULO_FUN_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_modulo{
+namespace xxx_fun{
+
+ void test();
+
+}// xxx_fun
+}// xxx_modulo
+}// xxx_put
+}// xxx_test_assign
+
+#endif

Added: sandbox/assign_v2/libs/assign/v2/test/put/modulo/std.cpp
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/modulo/std.cpp 2011-03-04 15:55:45 EST (Fri, 04 Mar 2011)
@@ -0,0 +1,58 @@
+//////////////////////////////////////////////////////////////////////////////
+// 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/typeof/typeof.hpp>
+#include <boost/lambda/lambda.hpp>
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/put/std/push_front.hpp>
+#include <boost/assign/v2/put/container/functor.hpp>
+#include <boost/assign/v2/put/deque/functor.hpp>
+#include <libs/assign/v2/test/put/std.h>
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_modulo{
+namespace xxx_std{
+
+ void test()
+ {
+ namespace as2 = boost::assign::v2;
+
+ /* Only have to check those that are in /std which are not in
+ /deduce/dependee.hpp */
+
+ {
+ //[put_std_push_front
+ typedef int T; T x = 1, y = 2, z = 0; std::deque<T> cont;
+ ( as2::put( cont ) % as2::_push_front )( z )( y )( x );
+ BOOST_ASSIGN_V2_CHECK( cont[0] == x );
+ BOOST_ASSIGN_V2_CHECK( cont[2] == z );
+ //]
+ }
+ {
+ typedef int T; T x = 1, y = 2, z = 0;
+ //[put_deque_std_front
+ BOOST_AUTO(
+ cont,
+ (
+ as2::deque<T>( as2::_nil ) % as2::_push_front
+ )( x )( y )( z )
+ );
+ BOOST_ASSIGN_V2_CHECK( cont[0] == z );
+ BOOST_ASSIGN_V2_CHECK( cont[2] == x );
+ //]
+ }
+
+ }
+
+}// xxx_std
+}// xxx_modulo
+}// xxx_put
+}// test_assign_v2

Added: sandbox/assign_v2/libs/assign/v2/test/put/modulo/std.h
==============================================================================
--- (empty file)
+++ sandbox/assign_v2/libs/assign/v2/test/put/modulo/std.h 2011-03-04 15:55:45 EST (Fri, 04 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_MODULO_STD_ER_2010_H
+#define LIBS_ASSIGN_V2_TEST_PUT_MODULO_STD_ER_2010_H
+
+namespace test_assign_v2{
+namespace xxx_put{
+namespace xxx_modulo{
+namespace xxx_std{
+
+ void test();
+
+}// xxx_std
+}// xxx_modulo
+}// xxx_put
+}// xxx_test_assign
+
+#endif


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