Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69676 - in sandbox/assign_v2: boost/assign/v2/put boost/assign/v2/ref boost/assign/v2/ref/array/functor boost/assign/v2/ref/list boost/assign/v2/utility/convert libs/assign/v2/test libs/assign/v2/test/put/container libs/assign/v2/test/put/pipe/functor libs/assign/v2/test/utility
From: erwann.rogard_at_[hidden]
Date: 2011-03-07 21:53:24


Author: e_r
Date: 2011-03-07 21:53:22 EST (Mon, 07 Mar 2011)
New Revision: 69676
URL: http://svn.boost.org/trac/boost/changeset/69676

Log:
upd assign_v2
Text files modified:
   sandbox/assign_v2/boost/assign/v2/put/deque.hpp | 1
   sandbox/assign_v2/boost/assign/v2/ref/array.hpp | 1
   sandbox/assign_v2/boost/assign/v2/ref/array/functor/converter.hpp | 16 ----------
   sandbox/assign_v2/boost/assign/v2/ref/list.hpp | 3 --
   sandbox/assign_v2/boost/assign/v2/ref/list/converter.hpp | 34 -----------------------
   sandbox/assign_v2/boost/assign/v2/utility/convert/converter.hpp | 4 +-
   sandbox/assign_v2/libs/assign/v2/test/other.cpp | 41 ----------------------------
   sandbox/assign_v2/libs/assign/v2/test/put/container/functor.cpp | 4 +-
   sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/operator.cpp | 4 --
   sandbox/assign_v2/libs/assign/v2/test/utility/convert.cpp | 56 ++++++++++++++++++++++++++++++++-------
   10 files changed, 56 insertions(+), 108 deletions(-)

Modified: sandbox/assign_v2/boost/assign/v2/put/deque.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/put/deque.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/put/deque.hpp 2011-03-07 21:53:22 EST (Mon, 07 Mar 2011)
@@ -11,6 +11,7 @@
 #define BOOST_ASSIGN_V2_PUT_DEQUE_ER_2010_HPP
 
 #include <boost/assign/v2/put/deque/cont.hpp>
+#include <boost/assign/v2/put/deque/converter.hpp>
 #include <boost/assign/v2/put/deque/csv.hpp>
 #include <boost/assign/v2/put/deque/functor.hpp>
 #include <boost/assign/v2/put/deque/replace.hpp>

Modified: sandbox/assign_v2/boost/assign/v2/ref/array.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/ref/array.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/ref/array.hpp 2011-03-07 21:53:22 EST (Mon, 07 Mar 2011)
@@ -12,5 +12,6 @@
 
 #include <boost/assign/v2/ref/array/csv.hpp>
 #include <boost/assign/v2/ref/array/functor.hpp>
+#include <boost/assign/v2/ref/array/converter.hpp>
 
 #endif

Modified: sandbox/assign_v2/boost/assign/v2/ref/array/functor/converter.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/ref/array/functor/converter.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/ref/array/functor/converter.hpp 2011-03-07 21:53:22 EST (Mon, 07 Mar 2011)
@@ -1,15 +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_REF_ARRAY_FUNCTOR_CONVERTER_ER_2010_HPP
-#define BOOST_ASSIGN_V2_REF_ARRAY_FUNCTOR_CONVERTER_ER_2010_HPP
-
-#include <boost/assign/v2/ref/list/converter.hpp>
-
-#endif
+// TODO remove file
\ No newline at end of file

Modified: sandbox/assign_v2/boost/assign/v2/ref/list.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/ref/list.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/ref/list.hpp 2011-03-07 21:53:22 EST (Mon, 07 Mar 2011)
@@ -19,7 +19,4 @@
 #include <boost/assign/v2/ref/list/size_type.hpp>
 #include <boost/assign/v2/ref/list/make.hpp>
 
-// Must remain commented out
-// #include <boost/assign/v2/ref/list/converter.hpp>
-
 #endif

Modified: sandbox/assign_v2/boost/assign/v2/ref/list/converter.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/ref/list/converter.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/ref/list/converter.hpp 2011-03-07 21:53:22 EST (Mon, 07 Mar 2011)
@@ -1,33 +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_REF_LIST_CONVERTER_ER_2010_HPP
-#define BOOST_ASSIGN_V2_REF_LIST_CONVERTER_ER_2010_HPP
-#include <boost/assign/v2/ref/list/fwd.hpp>
-#include <boost/assign/v2/utility/convert/converter.hpp>
-
-namespace boost{
-namespace assign{
-namespace v2{
-namespace ref{
-namespace list_aux{
-
-#define SEQ (Tag)(H)(T)
-#define U container<Tag, H, T>
-BOOST_ASSIGN_V2_CONVERTER(U, SEQ)
-#undef U
-#undef SEQ
-
-}// list_aux
-}// ref
-}// v2
-}// assign
-}// boost
-
-#endif
+// TODO remove file
\ No newline at end of file

Modified: sandbox/assign_v2/boost/assign/v2/utility/convert/converter.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/utility/convert/converter.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/utility/convert/converter.hpp 2011-03-07 21:53:22 EST (Mon, 07 Mar 2011)
@@ -96,11 +96,11 @@
 
 // Expanding
 // namespace ns{
-// BOOST_ASSIGN_V2_CONVERTER( cont<A,B,C>, (A)(B)(C) )
+// BOOST_ASSIGN_V2_CONVERTER( (A)(B)(C), cont<A,B,C> )
 // }
 // creates a name-lookup version of converter() for name ns::cont<A, B, C>
 
-#define BOOST_ASSIGN_V2_CONVERTER(U, Seq)\
+#define BOOST_ASSIGN_V2_CONVERTER(Seq, U)\
     template<BOOST_PP_SEQ_ENUM(\
         BOOST_PP_SEQ_TRANSFORM(\
             BOOST_ASSIGN_V2_CONVERTER_OP,\

Modified: sandbox/assign_v2/libs/assign/v2/test/other.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/other.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/other.cpp 2011-03-07 21:53:22 EST (Mon, 07 Mar 2011)
@@ -30,14 +30,12 @@
 #include <boost/assign/v2/ref/wrapper/range_get.hpp>
 #include <boost/assign/v2/ref/array/csv.hpp>
 #include <boost/assign/v2/ref/array/functor.hpp>
-#include <boost/assign/v2/ref/array/functor/converter.hpp>
+#include <boost/assign/v2/ref/array/converter.hpp>
 #include <boost/assign/v2/put/container.hpp>
 #include <boost/assign/v2/put/deque.hpp>
 #include <boost/assign/v2/put/container/functor.hpp>
 #include <boost/assign/v2/put/pipe/functor.hpp>
 #include <boost/assign/v2/put/pipe/csv.hpp>
-#include <boost/assign/v2/put/std.hpp>
-#include <boost/assign/v2/put/ext.hpp>
 #include <boost/assign/v2/utility/csv.hpp>
 #include <libs/assign/v2/test/other.h>
 
@@ -107,43 +105,6 @@
             BOOST_ASSIGN_V2_CHECK( z == r[2] );
             //]
         }
- // PUT + CSV
- // container.hpp
- {
- //[other_csv_put
- typedef int T; T x = 1, y = 2, z = 0; std::list<T> cont;
- as2::csv( as2::put( cont ) , x, y, z );
-
- BOOST_ASSIGN_V2_CHECK( cont.front() == x );
- BOOST_ASSIGN_V2_CHECK( cont.back() == z );
- //]
- BOOST_ASSIGN_V2_CHECK( *boost::next( boost::begin( cont ) ) == y );
- }
- // deque.hpp
- {
- //[other_csv_deque
- typedef int T; T x = 1, y = 2, z = 0;
- as2::result_of::deque<T>::type cont
- = as2::csv( as2::deque<T>( as2::_nil ), x, y, z );
-
- BOOST_ASSIGN_V2_CHECK( cont.front() == x );
- BOOST_ASSIGN_V2_CHECK( cont.back() == z );
- //]
- }
- // modulo.hpp
- {
- //[other_csv_put_modulo
- typedef int T; std::list<T> cont;
- as2::csv(
- as2::put( cont ) % ( as2::_fun = as2::_identity ),
- 1, 2, 0
- );
-
- BOOST_ASSIGN_V2_CHECK( cont.front() == 1 );
- BOOST_ASSIGN_V2_CHECK( cont.back() == 0 );
- //]
- BOOST_ASSIGN_V2_CHECK( *boost::next( boost::begin( cont ) ) == 2 );
- }
     }
 
 }// xxx_other

Modified: sandbox/assign_v2/libs/assign/v2/test/put/container/functor.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/container/functor.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/container/functor.cpp 2011-03-07 21:53:22 EST (Mon, 07 Mar 2011)
@@ -62,18 +62,18 @@
                                 /*<<Calls `ragged_array.push_back( r_( 1, -99.99 ) )`>>*/( 1, -99.99 )
                 /*<<Calls `ragged_array.push_back( r_( ) )`>>*/( );
 
- 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 );
+ //]
+ elem_ eps = boost::numeric::bounds<elem_>::smallest();
             BOOST_ASSIGN_V2_CHECK( abs( ragged_array[0].front() - a.front() ) < eps );
             BOOST_ASSIGN_V2_CHECK( abs( ragged_array[0].back() - a.back() ) < eps );
             BOOST_ASSIGN_V2_CHECK( abs( ragged_array[1].front() - b.front() ) < eps );
             BOOST_ASSIGN_V2_CHECK( abs( ragged_array[1].back() - b.back() ) < eps );
             BOOST_ASSIGN_V2_CHECK( abs( ragged_array[2].front() + 99.9 ) < eps );
             BOOST_ASSIGN_V2_CHECK( abs( ragged_array[2].back() + 99.9 ) < eps );
- //]
                 }
         {
             //[adapter

Modified: sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/operator.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/operator.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/pipe/functor/operator.cpp 2011-03-07 21:53:22 EST (Mon, 07 Mar 2011)
@@ -82,13 +82,11 @@
                         ( )
             )[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 );
-
+ elem_ eps = boost::numeric::bounds<elem_>::smallest();
             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 );

Modified: sandbox/assign_v2/libs/assign/v2/test/utility/convert.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/utility/convert.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/utility/convert.cpp 2011-03-07 21:53:22 EST (Mon, 07 Mar 2011)
@@ -14,6 +14,8 @@
 #include <boost/assign/v2/detail/config/check.hpp>
 #include <boost/assign/v2/utility/convert.hpp>
 #include <boost/assign/v2/utility/convert/check.hpp>
+#include <boost/assign/v2/ref/array.hpp>
+#include <boost/assign/v2/put/deque.hpp>
 #include <libs/assign/v2/test/utility/convert.h>
 
 
@@ -22,21 +24,20 @@
 namespace xxx_convert{
 
     // suggested by JB:
+ //[convert_f
     template<typename C, typename R>
     void f(C cont, R const& r){
         namespace as2 = boost::assign::v2;
         as2::check_aux::equal_container( cont, r );
     }
-
+ //]
+
     void test()
     {
         namespace as2 = boost::assign::v2;
         namespace ns = as2::check_aux;
 
- {
- // containers developed in this library are tested in conjunction
- // with converter() in their respective directories
- }
+ // Non-Boost.Assign.2.0 containers - fully qualified as2::converter()
         {
             //[convert_inpl
             std::vector<int> v( 3 ); v[0] = 1; v[1] = 2; v[2] = 0;
@@ -54,31 +55,66 @@
         }
         {
             //[convert_copy
- std::vector<int> v( 3 ); v[0] = -1; v[1] = 0; v[2] = 1;
+ std::vector<int> v( 3 ); v[0] = 72; v[1] = 31; v[2] = 48;
             std::stack<int> lifo = as2::converter( v );
- BOOST_ASSIGN_V2_CHECK( lifo.top() == 1 );
+ BOOST_ASSIGN_V2_CHECK( lifo.top() == 48 );
             //]
         }
         {
- typedef int T;
- typedef std::vector<int> R; R r( 3 ); r[0] = 1; r[1] = 2; r[2] = 0;
-
             {
+ typedef int T;
+ typedef std::vector<T> R; R r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
                 typedef std::vector<T> C; f<C>( as2::converter( r ), r );
             }
             {
+ typedef int T;
+ typedef std::vector<T> R; R r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
                 typedef std::deque<T> C; f<C>( as2::converter( r ), r );
             }
             {
+ typedef int T;
+ typedef std::vector<T> R; R r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
                 typedef std::list<T> C; f<C>( as2::converter( r ), r );
             }
             {
+ //[convert_f_invoke
+ typedef int T;
+ typedef std::vector<T> R; R r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
                 typedef std::stack<T> C; f<C>( as2::converter( r ), r );
+ //]
             }
             {
+ typedef int T;
+ typedef std::vector<T> R; R r( 3 ); r[0] = 72; r[1] = 31; r[2] = 48;
                 typedef std::queue<T> C; f<C>( as2::converter( r ), r );
             }
         }
+
+ // Non-Boost.Assign.2.0 containers - name lookup
+ {
+ //[convert_array
+ std::stack<int> lifo = /*<<Notice unqualified (name lookup)>>*/converter( as2::ref::array( 72 )( 31 )( 48 ) );
+ BOOST_ASSIGN_V2_CHECK( lifo.top() == 48 );
+ //]
+ }
+ {
+ //[convert_csv_array
+ std::stack<int> lifo = /*<<Notice unqualified (name lookup)>>*/converter( as2::ref::csv_array( 72, 31, 48 ) );
+ BOOST_ASSIGN_V2_CHECK( lifo.top() == 48 );
+ //]
+ }
+ {
+ //[convert_deque
+ std::stack<int> lifo = /*<<Notice unqualified (name lookup)>>*/converter( as2::deque<int>( 72 )( 31 )( 48 ) );
+ BOOST_ASSIGN_V2_CHECK( lifo.top() == 48 );
+ //]
+ }
+ {
+ //[convert_csv_array
+ std::stack<int> lifo = /*<<Notice unqualified (name lookup)>>*/converter( as2::csv_deque( 72, 31, 48 ) );
+ BOOST_ASSIGN_V2_CHECK( lifo.top() == 48 );
+ //]
+ }
     }
 
 }// xxx_convert


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