Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69993 - in sandbox/assign_v2: boost/assign/v2/ref/array libs/assign/v2/test/put
From: erwann.rogard_at_[hidden]
Date: 2011-03-14 19:55:19


Author: e_r
Date: 2011-03-14 19:55:16 EDT (Mon, 14 Mar 2011)
New Revision: 69993
URL: http://svn.boost.org/trac/boost/changeset/69993

Log:
upd assign_v2
Text files modified:
   sandbox/assign_v2/boost/assign/v2/ref/array/interface.hpp | 4 +-
   sandbox/assign_v2/libs/assign/v2/test/put/ptr.cpp | 55 +++++++++++++++------------------------
   sandbox/assign_v2/libs/assign/v2/test/put/put.cpp | 23 +++++++---------
   3 files changed, 33 insertions(+), 49 deletions(-)

Modified: sandbox/assign_v2/boost/assign/v2/ref/array/interface.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/ref/array/interface.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/ref/array/interface.hpp 2011-03-14 19:55:16 EDT (Mon, 14 Mar 2011)
@@ -82,7 +82,7 @@
 //<-
         BOOST_STATIC_CONSTANT(size_type, static_size/*<-*/ = Impl::static_size/*->*/);
 //->
- /*<-*/BOOST_ASSIGN_V2_IGNORE(/*->*/size_type static_size/*<-*/)/*->*/;
+ /*<-*/BOOST_ASSIGN_V2_IGNORE(/*->*/size_type static_size;/*<-*/)/*->*/
 
         iterator begin()/*<-*/
         {
@@ -160,7 +160,7 @@
         template<typename W>
         reference elem_impl(W& w)
         {
- return w;
+ return w;
         }
         template<typename W>
         const_reference elem_impl(W & w)const

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-14 19:55:16 EDT (Mon, 14 Mar 2011)
@@ -7,18 +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 <string>
+#include <boost/assign/v2/detail/config/check.hpp>
+#include <boost/assign/v2/detail/pp/ignore.hpp>
+#include <boost/assign/v2/put/put.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_map.hpp>
-#include <boost/ptr_container/ptr_set.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/config/check.hpp>
-#include <boost/assign/v2/put/put.hpp>
-*/
-#include <boost/assign/v2/detail/pp/ignore.hpp>
 #include <libs/assign/v2/test/put/ptr.h>
 
 namespace test_assign_v2{
@@ -26,43 +24,35 @@
 namespace xxx_ptr{
 
     void test(){
-// TODO
-/*
+
         namespace as2 = boost::assign::v2;
+
+// TODO
         {
- //[put_ptr_array
- typedef int T;
- T x = 1, y = 2, z = 3; boost::ptr_array<T, 3> cont;
- as2::put( cont )( x )( y )( z );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert(/*<-*/))/*->*/cont[0] == x );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert(/*<-*/))/*->*/cont[2] == z );
+ //[test_put_ptr_array
+ //typedef int T;
+ //T x = 1, y = 2, z = 3; boost::ptr_array<T, 3> cont;
+ //as2::put( cont )( x )( y )( z );
             //]
         }
         {
- //[put_ptr_deque
- typedef int T; T x = 1, y = 2, z = 0; boost::ptr_deque<T> cont;
- as2::put( cont )( x )( y )( z );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert(/*<-*/))/*->*/cont.front() == x );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert(/*<-*/))/*->*/cont.back() == z );
+ //[test_put_ptr_deque
+ //typedef int T; T x = 1, y = 2, z = 0; boost::ptr_deque<T> cont;
+ //as2::put( cont )( x )( y )( z );
             //]
         }
         {
- //[put_ptr_list
- typedef int T; T x = 1, y = 2, z = 0; boost::ptr_list<T> cont;
- as2::put( cont )( x )( y )( z );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert(/*<-*/))/*->*/cont.front() == x );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert(/*<-*/))/*->*/cont.back() == z );
+ //[test_put_ptr_list
+ //typedef int T; T x = 1, y = 2, z = 0; boost::ptr_list<T> cont;
+ //as2::put( cont )( x )( y )( z );
             //]
         }
         {
- //[put_ptr_vector
- typedef int T; T x = 1, y = 2, z = 0; boost::ptr_vector<T> cont;
- as2::put( cont )( x )( y )( z );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert(/*<-*/))/*->*/cont.front() == x );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert(/*<-*/))/*->*/cont.back() == z );
+ //[test_put_ptr_vector
+ //typedef int T; T x = 1, y = 2, z = 0; boost::ptr_vector<T> cont;
+ //as2::put( cont )( x )( y )( z );
             //]
         }
-*/
 
 
 /*
@@ -71,7 +61,6 @@
             //[put_ptr_map
             boost::ptr_map<std::string, int> assoc;
             as2::put( assoc )( "jan", 31 )( "feb", 28 )( "mar", 31 );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert(/*<-*/))/*->*/assoc["feb"] == 28 );
             //]
         }
         {
@@ -80,8 +69,6 @@
             boost::ptr_set<T> assoc;
             T x = "isomer", y = "ephemeral", z = "prosaic";
             as2::put( assoc )( x )( y )( z );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert(/*<-*/))/*->*/assoc.count( x ) == 1 );
- /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert(/*<-*/))/*->*/assoc.count( z ) == 1 );
             //]
         }
 */

Modified: sandbox/assign_v2/libs/assign/v2/test/put/put.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/put/put.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/put/put.cpp 2011-03-14 19:55:16 EDT (Mon, 14 Mar 2011)
@@ -37,28 +37,25 @@
 namespace xxx_put{
 
     void test(){
-
+
         using namespace boost;
         namespace as2 = assign::v2;
 
         {
              //[test_put_put_bitset
- typedef std::string str_; typedef std::bitset<3> data_; /*<<Keep in mind that although `data_( str_( "011" ) )`, for instance, is valid, `consecutive.push_back( str_( "011" ) )` isn't (GCC4.2)>>*/ std::vector<data_> consecutive;
+ typedef std::string str_; typedef std::bitset<3> data_; /*<<Keep in mind that although `data_( str_( "011" ) )`, for instance, is valid, `consecutive.push_back( str_( "011" ) )` isn't (GCC4.2)>>*/ std::vector<data_> consecutive;
             /*<<Calls `consecutive.push_back( data_( t ) );` for [^t = ]`str_( "000" )`[^, ..., ]`str_( "111" )`[^\]]>>*/as2::put( consecutive )
                 ( str_( "000" ) )( str_( "001" ) )
                 ( str_( "010" ) )( str_( "011" ) )
                 ( str_( "100" ) )( str_( "101" ) )
                 ( str_( "110" ) )( str_( "111" ) );
-
- for(int i = 0; i < consecutive.size(); i++)
- {
- assert( consecutive[i].to_ulong() == i );
- }
- //]
- for(int i = 0; i < consecutive.size(); i++)
+
+ for(unsigned i = 0; i < consecutive.size(); i++)
             {
                 /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/ consecutive[i].to_ulong() == i );
             }
+ //]
+ // unsigned i else warning comparison between signed & unsigned
         }
         {
              //[test_put_put_numeric_kb
@@ -76,10 +73,10 @@
         }
         {
             //[test_put_put_ragged
- typedef double data_; typedef std::vector<data_> variable_size_;
+ typedef double data_; typedef std::vector<data_> variable_size_;
             variable_size_ a( 3 ); a[0] = 0.71; a[1] = 0.63; a[2] = 0.85;
             variable_size_ b( 4 ); b[0] = 0.61; b[1] = 0.69; b[2] = 0.92; b[3] = 0.55;
- array<variable_size_, 4> ragged;
+ array<variable_size_, 4> ragged;
             as2::put( ragged )
                 /*<<Calls `ragged.push_back( variable_size_( begin( a ), end( a ) ) )`>>*/( begin( a ), end( a ) )
                 /*<<Calls `ragged.push_back( variable_size_( b ) )`>>*/( b )
@@ -118,10 +115,10 @@
             /*<-*/BOOST_ASSIGN_V2_CHECK( BOOST_ASSIGN_V2_IGNORE(/*->*/assert( /*<-*/))/*->*/ seq.back() == 48 );
         }
         {
- // http://bioinfo.mbb.yale.edu/~mbg/dom/fun3/area-codes/
+ // http://bioinfo.mbb.yale.edu/~mbg/dom/fun3/area-codes/
             //[test_put_put_area_codes
             typedef const char us_state_ [3]; us_state_ ct = "CT", nj = "NJ", ny = "NY";
- typedef int area_code_; typedef tuple<us_state_/*<<Notice the [*reference]>>*/&, area_code_> data_; std::deque< data_ > tri_state_area;
+ typedef int area_code_; typedef tuple<us_state_/*<<Notice the [*reference]>>*/&, area_code_> data_; std::deque< data_ > tri_state_area;
             /*<<Calls `tri_state.push_back( data_( s, c ) )` for [^( s, c ) =( ny, 212 )...( ct, 203 )]>>*/
             as2::put( tri_state_area )( ny, 212 )( ny, 718 )( ny, 516 )( ny, 914 )( nj, 210 )( nj, 908 )( nj, 609 )( ct, 203 );
 


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