Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68336 - in sandbox/assign_v2: boost/assign/v2/utility/chain/checking libs/assign/v2/test/utility
From: erwann.rogard_at_[hidden]
Date: 2011-01-20 20:39:12


Author: e_r
Date: 2011-01-20 20:39:11 EST (Thu, 20 Jan 2011)
New Revision: 68336
URL: http://svn.boost.org/trac/boost/changeset/68336

Log:
upd assign_v2
Text files modified:
   sandbox/assign_v2/boost/assign/v2/utility/chain/checking/distinct_values.hpp | 73 ---------------
   sandbox/assign_v2/boost/assign/v2/utility/chain/checking/twin_values.hpp | 189 ---------------------------------------
   sandbox/assign_v2/libs/assign/v2/test/utility/chain.cpp | 10 -
   3 files changed, 5 insertions(+), 267 deletions(-)

Modified: sandbox/assign_v2/boost/assign/v2/utility/chain/checking/distinct_values.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/utility/chain/checking/distinct_values.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/utility/chain/checking/distinct_values.hpp 2011-01-20 20:39:11 EST (Thu, 20 Jan 2011)
@@ -1,72 +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_CHAIN_CHECKING_DISTINCT_VALUES_ER_2010_HPP
-#define BOOST_ASSIGN_V2_CHAIN_CHECKING_DISTINCT_VALUES_ER_2010_HPP
-#include <vector>
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/assign/v2/detail/checking/constants.hpp>
-#include <boost/assign/v2/detail/checking/container.hpp>
-#include <boost/assign/v2/utility/chain/pipe.hpp>
-
-namespace boost{
-namespace assign{
-namespace v2{
-namespace checking{
-namespace chain{
-namespace distinct_values{
-
-// If the value types of the two ranges differ, their references must be
-// converted to value_type. In particular, lvalue cannot be preserved.
-
-#define MACRO(T1,T2)\
- template<typename T>\
- void do_check(typename boost::enable_if<boost::is_same<T,T1> >::type* = 0)\
- {\
- typedef T1 t1_;\
- typedef T2 t2_;\
- typedef std::vector<T1> vec1_;\
- typedef std::vector<T2> vec2_;\
- vec1_ vec1, vec3;\
- vec2_ vec2;\
- {\
- namespace ns = v2::checking::constants;\
- vec1.push_back( ns::a );\
- vec1.push_back( ns::b );\
- vec2.push_back( ns::c );\
- vec2.push_back( ns::d );\
- vec2.push_back( ns::e );\
- vec3.push_back( ns::f );\
- vec3.push_back( ns::g );\
- vec3.push_back( ns::h );\
- }\
- namespace chk = checking::container;\
- {\
- chk::do_check( vec1 | _chain( vec2 ) | _chain( vec3 ) );\
- }\
- }\
-/**/
-
-
-MACRO(short , int)
-MACRO(int , long)
-MACRO(float , double)
-MACRO(double , long double)
-
-#undef MACRO
-
-}// distinct_values
-}// chain
-}// checking
-}// v2
-}// assign
-}// boost
-
-#endif
+// TODO remove file
\ No newline at end of file

Modified: sandbox/assign_v2/boost/assign/v2/utility/chain/checking/twin_values.hpp
==============================================================================
--- sandbox/assign_v2/boost/assign/v2/utility/chain/checking/twin_values.hpp (original)
+++ sandbox/assign_v2/boost/assign/v2/utility/chain/checking/twin_values.hpp 2011-01-20 20:39:11 EST (Thu, 20 Jan 2011)
@@ -1,188 +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_CHAIN_CHECKING_TWIN_VALUES_ER_2010_HPP
-#define BOOST_ASSIGN_V2_CHAIN_CHECKING_TWIN_VALUES_ER_2010_HPP
-#include <boost/static_assert.hpp>
-#include <vector>
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/identity.hpp>
-#include <boost/mpl/assert.hpp>
-#include <boost/type_traits/add_const.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/range/algorithm/copy.hpp>
-#include <boost/assign/v2/detail/checking/range.hpp>
-#include <boost/assign/v2/ref/wrapper/get.hpp>
-#include <boost/assign/v2/ref/wrapper/copy.hpp>
-#include <boost/assign/v2/utility/chain/use_lvalue.hpp>
-#include <boost/assign/v2/utility/chain/pipe.hpp>
-
-namespace boost{
-namespace assign{
-namespace v2{
-namespace checking{
-namespace chain{
-namespace twin_values{
-
-template<typename cr1_, typename cr2_, bool the_value>
-void verify_use_lvalue()
-{
- typedef v2::chain_aux::use_lvalue<cr1_, cr2_> use_lvalue_;
- BOOST_STATIC_ASSERT( use_lvalue_::value == the_value );
- typedef typename ::boost::mpl::eval_if_c<
- the_value,
- ::boost::mpl::identity<boost::mpl::void_>, // why?
- v2::result_of::chain<cr1_, cr2_>
- >::type result_;
-}
-
-template<bool x, typename T>
-struct add_const_if : ::boost::mpl::eval_if_c<
- x, boost::add_const<T>, ::boost::mpl::identity<T>
->{};
-
-template<typename T, bool qual_v1, bool qual_e2, bool qual_v2, bool the_value>
-void verify_mpl()
-{
- namespace as2 = assign::v2;
- // Value container
- typedef std::vector<T> vec_t_;
- typedef typename add_const_if<qual_v1, vec_t_ >::type vec1_;
- typedef typename as2::ref::copy_wrapper<
- typename add_const_if<qual_e2, T>::type
- >::type w_;
- typedef vec1_ r1_; // alias
-
- // Ref-wrappers
- typedef std::vector<w_> vec_w_;
- typedef typename add_const_if<qual_v2, vec_w_ >::type vec2_;
- // Transformation through range_get (necessary)
- typedef typename ref::result_of::range_get<vec2_>::type r2_;
-
- {
- typedef r1_ cr1_;
- typedef r2_ cr2_;
- verify_use_lvalue<cr1_, cr2_, the_value>();
- verify_use_lvalue<cr2_, cr1_, the_value>();
- }
- {
- typedef r1_ cr1_;
- typedef r2_ const cr2_;
- verify_use_lvalue<cr1_, cr2_, the_value>();
- verify_use_lvalue<cr2_, cr1_, the_value>();
- }
-}
-
- template<typename T>
- void do_check()
- {
- // mpl checks
- {
- typedef std::vector<T> vec_;
- typedef v2::result_of::chain<vec_, vec_> caller1_;
- typedef typename caller1_::type range1_;
- typedef typename boost::range_reference<range1_>::type ref1_;
- BOOST_MPL_ASSERT(( boost::is_same<ref1_, T&> ));
- typedef v2::result_of::chain<range1_ const, vec_> caller2_;
- typedef typename caller2_::type range2_;
- typedef typename boost::range_reference<range2_>::type ref2_;
- BOOST_MPL_ASSERT(( boost::is_same<ref2_, T&> ));
- }
-
-// verify_mpl<T, qual_v1, qual_e2 , qual_v2 , the_value>()
- verify_mpl<T, false , false , false , true >();
- verify_mpl<T, false , false , true , true >();
- verify_mpl<T, false , true , false , false >();
- verify_mpl<T, false , true , true , false >();
- verify_mpl<T, true , false , false , false >();
- verify_mpl<T, true , false , true , false >();
- verify_mpl<T, true , true , false , false >();
- verify_mpl<T, true , true , true , false >();
-
- // runtime checks
- {
- typedef std::vector<T> vt_;
- vt_ vt1( 2 ), vt2( 3 ), vt3( 3 );
- vt_ vt;
- {
- // Value containers
- namespace ns = v2::checking::constants;
- vt.push_back( ns::a ); // 1
- vt.push_back( ns::b ); // 2
-
- vt.push_back( ns::c ); // 1
- vt.push_back( ns::d ); // 2
- vt.push_back( ns::e ); // 3
-
- vt.push_back( ns::f ); // 1
- vt.push_back( ns::g ); // 2
- vt.push_back( ns::h ); // 3
- {
-
- BOOST_ASSIGN_V2_CHECK( // pre-condition
- vt1.size() + vt2.size() + vt3.size() == vt.size()
- );
- boost::copy(
- vt,
- boost::begin( vt1 | _chain( vt2 ) | _chain( vt3 ) )
- );
- }
- {
- typedef v2::container_tag::range tag_;
- v2::checking::do_check(
- tag_(),
- vt1 | _chain( vt2 ) | _chain( vt3 )
- );
- }
- }
- {
- // Mix and Value and Ref-wrapper containers
-
- typedef typename ref::copy_wrapper<T>::type w_;
- typedef boost::is_reference_wrapper<w_> is_;
-
- // rese to default values
- vt1.resize( vt1.size() );
- vt3.resize( vt3.size() );
-
- T x = -1, y = -1, z = -1;
- boost::array<w_, 3> vw2;
- // Wrappers must bind first!
- vw2[0].rebind( x );
- vw2[1].rebind( y );
- vw2[2].rebind( z );
- boost::copy(
- vt,
- boost::begin(
- vt1 | _chain(
- vw2 | ref::_get // necessary
- ) | _chain( vt3 ) )
- );
- {
- namespace ns = v2::checking::constants;
- ns::do_check(
- vt1[0], vt1[1],
- x, y, z,
- vt3[0], vt3[1], vt3[2]
- );
- }
- // suppresses warning unused
- if(x && y && z){}
- }
- }// runtime checks
- }// do_check
-
-}// twin_values
-}// chain
-}// checking
-}// v2
-}// assign
-}// boost
-
-#endif
+// TODO remove file
\ No newline at end of file

Modified: sandbox/assign_v2/libs/assign/v2/test/utility/chain.cpp
==============================================================================
--- sandbox/assign_v2/libs/assign/v2/test/utility/chain.cpp (original)
+++ sandbox/assign_v2/libs/assign/v2/test/utility/chain.cpp 2011-01-20 20:39:11 EST (Thu, 20 Jan 2011)
@@ -7,8 +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 <boost/assign/v2/utility/chain/checking/twin_values.hpp>
-#include <boost/assign/v2/utility/chain/checking/distinct_values.hpp>
+#include <boost/assign/v2/utility/chain/check.hpp>
 #include <libs/assign/v2/test/utility/chain.h>
 
 namespace test_assign_v2{
@@ -19,11 +18,8 @@
     {
             namespace as2 = boost::assign::v2;
         namespace ns = as2::checking::chain;
- ns::twin_values::do_check<int>();
- //ns::distinct_values::do_check<short>();
- //ns::distinct_values::do_check<int>();
- //ns::distinct_values::do_check<float>();
- //ns::distinct_values::do_check<double>();
+ ns::do_check<int>();
+ ns::do_check<double>();
     }
 
 }// xxx_chain


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