Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60704 - in sandbox/statistics/detail/assign: boost/assign/auto_size/check libs/assign/example libs/assign/src
From: erwann.rogard_at_[hidden]
Date: 2010-03-19 01:13:49


Author: e_r
Date: 2010-03-19 01:13:48 EDT (Fri, 19 Mar 2010)
New Revision: 60704
URL: http://svn.boost.org/trac/boost/changeset/60704

Log:
m
Text files modified:
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/all.hpp | 25 +++------------
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/chain.hpp | 62 +++++++++++++++++----------------------
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/copy_iterator.hpp | 8 +++-
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/example1.hpp | 52 +++++++++++---------------------
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/iterator.hpp | 9 +++--
   sandbox/statistics/detail/assign/libs/assign/example/chain.cpp | 8 +---
   sandbox/statistics/detail/assign/libs/assign/src/main.cpp | 2
   7 files changed, 65 insertions(+), 101 deletions(-)

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/check/all.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/check/all.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/all.hpp 2010-03-19 01:13:48 EDT (Fri, 19 Mar 2010)
@@ -17,19 +17,18 @@
 #include <boost/array.hpp>
 #include <boost/range/algorithm/max_element.hpp>
 
-//#include <boost/assign/auto_size/chain/mpl_check.hpp>
+#include <boost/assign/auto_size/chain/mpl_check.hpp>
 
 #include <boost/assign/auto_size/check/array.hpp>
-//#include <boost/assign/auto_size/check/chain.hpp>
+#include <boost/assign/auto_size/check/chain.hpp>
 #include <boost/assign/auto_size/check/converter.hpp>
 #include <boost/assign/auto_size/check/copy_array.hpp>
 #include <boost/assign/auto_size/check/copy_iterator.hpp>
-//#include <boost/assign/auto_size/check/example1.hpp>
+#include <boost/assign/auto_size/check/example1.hpp>
 #include <boost/assign/auto_size/check/fifo.hpp>
 #include <boost/assign/auto_size/check/iterator.hpp>
 #include <boost/assign/auto_size/check/lifo.hpp>
 #include <boost/assign/auto_size/check/rebind_array.hpp>
-//#include <boost/assign/auto_size/check/ref_list_of_caller.hpp>
 
 #define BOOST_ASSIGN_AS_CHECK_all(fun) \
 namespace boost{ \
@@ -39,6 +38,7 @@
                                                                                \
 template<typename T> \
 void fun(){ \
+ BOOST_ASSIGN_AS_CHECK_example1 \
     BOOST_ASSIGN_AS_CHECK_iterator \
     BOOST_ASSIGN_AS_CHECK_array \
     BOOST_ASSIGN_AS_CHECK_copy_iterator \
@@ -51,6 +51,8 @@
     BOOST_ASSIGN_AS_CHECK_converter_sorted(std::set<T>) \
     BOOST_ASSIGN_AS_CHECK_adapter_lifo(std::stack<T>) \
     BOOST_ASSIGN_AS_CHECK_adapter_fifo(std::queue<T>) \
+ chain_mpl_check::compound(); \
+ BOOST_ASSIGN_AS_CHECK_chain \
 } \
 void fun(){ fun<int>(); } \
 } \
@@ -59,21 +61,6 @@
 } \
 /**/
 
-/*
- boost::assign::detail::chain_mpl_check::compound();
- {
- val_ a, b, c, d, e, f, g, h;
- BOOST_AUTO(tmp1,ref_list_of(a)(b)(c)(d));
- check_chain(
- tmp1,
- cref_list_of(e)(f)(g)(h),
- a,b,c,d,e,f,g,h);
- }
- // TODO comparison operators
-}
-
-*/
-
 
 #endif
 

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/check/chain.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/check/chain.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/chain.hpp 2010-03-19 01:13:48 EDT (Fri, 19 Mar 2010)
@@ -12,6 +12,7 @@
 #include <boost/typeof/typeof.hpp>
 #include <boost/assign/auto_size/chain/chain_convert.hpp>
 #include <boost/assign/auto_size/check/iterator.hpp>
+#include <boost/assign/auto_size/check/constants.hpp>
 #include <boost/assign/auto_size/check/copy_iterator.hpp>
 #include <boost/assign/auto_size/reference_wrapper/conversion_traits.hpp> // MUST be included
 
@@ -19,42 +20,33 @@
 #error
 #endif
 
-namespace boost{
-namespace assign{
-namespace detail{
-namespace auto_size{
+#define BOOST_ASSIGN_AS_CHECK_chain \
+{ \
+ typedef T val_; \
+ using namespace check_constants; \
+ BOOST_AUTO(tmp1,BOOST_ASSIGN_AS_CHECK_ref3(a,b,c)); \
+ BOOST_AUTO(tmp2,BOOST_ASSIGN_AS_CHECK_ref3(d,e,f)); \
+ BOOST_AUTO(tmp3,BOOST_ASSIGN_AS_CHECK_ref2(g,h)); \
+ typedef boost::array<T,2> ar2_; \
+ typedef boost::array<T,3> ar3_; \
+ ar3_ ar1, ar2; \
+ ar2_ ar3; \
+ ar1[0] = a; ar1[1] = b; ar1[2] = c; \
+ ar2[0] = d; ar2[1] = e; ar2[2] = f; \
+ ar3[0] = g; ar3[1] = h; \
+ BOOST_ASSIGN_AS_CHECK_iterator_f(chain_convert_r(ar1)(ar2)(ar3)) \
+ BOOST_ASSIGN_AS_CHECK_iterator_f(chain_convert_r(ar1)(ar2)(tmp3)) \
+ BOOST_ASSIGN_AS_CHECK_iterator_f(chain_convert_r(ar1)(tmp2)(ar3)) \
+ BOOST_ASSIGN_AS_CHECK_iterator_f(chain_convert_r(ar1)(tmp2)(tmp3)) \
+ BOOST_ASSIGN_AS_CHECK_iterator_f(chain_convert_r(tmp1)(ar2)(ar3)) \
+ BOOST_ASSIGN_AS_CHECK_iterator_f(chain_convert_r(tmp1)(ar2)(tmp3)) \
+ BOOST_ASSIGN_AS_CHECK_iterator_f(chain_convert_r(tmp1)(tmp2)(ar3)) \
+ BOOST_ASSIGN_AS_CHECK_iterator_f(chain_convert_r(tmp1)(tmp2)(tmp3)) \
+} \
+/**/
 
- // Usage
- // BOOST_AUTO(tmp,ref_list_of(a)(b)(c)(d));
- // check_chain(tmp,cref_list_of(e)(f)(g)(h),
- // a,b,c,d,e,f,g,h);
+// BOOST_ASSIGN_AS_CHECK_copy_iterator_f(chain_convert_l(ar1)(ar2)(ar3)) \
+// check_copy_iterator(tmp1,a,b,c,d,e,f,g,h); \
 
- // TODO const C1.
- template<typename C,typename C1,typename T>
- void check_chain(C& coll,const C1& coll1,
- T& a, T& b, T& c, T& d, T& e, T& f, T& g, T& h
- )
- {
- a = 1, b = 5, c = 3,
- d = 4, e = 2, f = 9,
- g = 0, h = 7;
-
- typedef boost::array<T,4> ar_;
- ar_ ar;
- ar[0] = e;
- ar[1] = f;
- ar[2] = g;
- ar[3] = h;
- BOOST_AUTO(tmp1,chain_convert_l(coll)(ar));
- BOOST_AUTO(tmp2,chain_convert_r(coll)(coll1));
- //check_iterator(tmp1,a,b,c,d,e,f,g,h);
- //check_iterator(tmp2,a,b,c,d,e,f,g,h);
- //check_copy_iterator(tmp1,a,b,c,d,e,f,g,h);
- }
-
-}// auto_size
-}// detail
-}// assign
-}// boost
 
 #endif

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/check/copy_iterator.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/check/copy_iterator.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/copy_iterator.hpp 2010-03-19 01:13:48 EDT (Fri, 19 Mar 2010)
@@ -17,7 +17,7 @@
 #error
 #endif
 
-#define BOOST_ASSIGN_AS_CHECK_copy_iterator \
+#define BOOST_ASSIGN_AS_CHECK_copy_iterator_f(arg) \
 { \
     typedef T val_; \
     using namespace check_constants; \
@@ -31,7 +31,7 @@
     ar[6] = g; \
     ar[7] = h; \
     val_ a1, b1, c1, d1, e1, f1, g1, h1; \
- BOOST_AUTO(tmp,BOOST_ASSIGN_AS_CHECK_ref8(a1,b1,c1,d1,e1,f1,g1,h1)); \
+ BOOST_AUTO(tmp,arg); \
     std::copy(boost::begin(ar),boost::end(ar),boost::begin(tmp)); \
     BOOST_ASSIGN_CHECK_EQUAL(a , a1); \
     BOOST_ASSIGN_CHECK_EQUAL(b , b1); \
@@ -44,4 +44,8 @@
 } \
 /**/
 
+#define BOOST_ASSIGN_AS_CHECK_copy_iterator \
+BOOST_ASSIGN_AS_CHECK_copy_iterator_f(BOOST_ASSIGN_AS_CHECK_ref8(a1,b1,c1,d1,e1,f1,g1,h1))\
+/**/
+
 #endif

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/check/example1.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/check/example1.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/example1.hpp 2010-03-19 01:13:48 EDT (Fri, 19 Mar 2010)
@@ -9,41 +9,25 @@
 #ifndef BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_EXAMPLE1_ER_2010_HPP
 #define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_EXAMPLE1_ER_2010_HPP
 #include <boost/range/algorithm/max_element.hpp>
-#include <boost/range/algorithm/copy.hpp> // tmp
-#include <iostream>
 
-namespace boost{
-namespace assign{
-namespace detail{
-namespace auto_size{
-
-template<typename Caller>
-void check_example1()
-{
- typedef typename Caller::value_type val_;
- typedef typename Caller::template apply<false>::type caller_l_;
- typedef typename Caller::template apply<true>::type caller_r_;
- using namespace boost::assign;
-
- using namespace check_constants;
- val_ a1 = a, b1 = b, c1 = c, d1 = d,
- e1 = e, f1 = f, g1 = g, h1 = h;
-
- val_& max = *boost::max_element(
- caller_l_::call(a1, b1, c1, d1, e1, f1, g1, h1) );
- BOOST_ASSIGN_CHECK_EQUAL( max , f1 );
- max = 8;
- //BOOST_ASSIGN_CHECK_EQUAL( f1 , 8 );
- const val_& const_max = *boost::max_element(
- caller_r_::call(a, b, c, d1, e1, f1, g1, h1) );
- //BOOST_ASSIGN_CHECK_EQUAL( max , const_max );
-
-}
-
-}// auto_size
-}// detail
-}// assign
-}// boost
+#define BOOST_ASSIGN_AS_CHECK_example1 \
+{ \
+ typedef T val_; \
+ using namespace check_constants; \
+ val_ a1 = a, b1 = b, c1 = c, d1 = d, \
+ e1 = e, f1 = f, g1 = g, h1 = h; \
+ \
+ val_& max = *boost::max_element( \
+ BOOST_ASSIGN_AS_CHECK_ref8(a1, b1, c1, d1, e1, f1, g1, h1) ); \
+ BOOST_ASSIGN_CHECK_EQUAL( max , f1 ); \
+ max = 8; \
+ BOOST_ASSIGN_CHECK_EQUAL( f1 , 8 ); \
+ const val_& const_max = *boost::max_element( \
+ BOOST_ASSIGN_AS_CHECK_cref8(a, b, c, d1, e1, f1, g1, h1) ); \
+ BOOST_ASSIGN_CHECK_EQUAL( max , const_max ); \
+ \
+} \
+/**/
 
 #endif
 

Modified: sandbox/statistics/detail/assign/boost/assign/auto_size/check/iterator.hpp
==============================================================================
--- sandbox/statistics/detail/assign/boost/assign/auto_size/check/iterator.hpp (original)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/iterator.hpp 2010-03-19 01:13:48 EDT (Fri, 19 Mar 2010)
@@ -11,19 +11,17 @@
 #include <boost/typeof/typeof.hpp>
 #include <boost/next_prior.hpp>
 #include <boost/range.hpp>
-#include <iostream>
 #include <boost/assign/auto_size/check/constants.hpp>
 
 #ifndef BOOST_ASSIGN_CHECK_EQUAL
 #error
 #endif
 
-#define BOOST_ASSIGN_AS_CHECK_iterator \
+#define BOOST_ASSIGN_AS_CHECK_iterator_f(arg) \
 { \
     typedef T val_; \
     using namespace check_constants; \
- BOOST_AUTO(tmp,BOOST_ASSIGN_AS_CHECK_cref8(a,b,c,d,e,f,g,h)); \
- \
+ BOOST_AUTO(tmp,arg); \
     BOOST_AUTO(it,boost::begin(tmp)); \
     BOOST_ASSIGN_CHECK_EQUAL(*boost::next(it,0), a); \
     BOOST_ASSIGN_CHECK_EQUAL(*boost::next(it,1), b); \
@@ -37,4 +35,7 @@
 } \
 /**/
 
+#define BOOST_ASSIGN_AS_CHECK_iterator BOOST_ASSIGN_AS_CHECK_iterator_f(BOOST_ASSIGN_AS_CHECK_cref8(a,b,c,d,e,f,g,h)) \
+
+
 #endif

Modified: sandbox/statistics/detail/assign/libs/assign/example/chain.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/example/chain.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/example/chain.cpp 2010-03-19 01:13:48 EDT (Fri, 19 Mar 2010)
@@ -11,13 +11,10 @@
 #include <boost/range/algorithm/copy.hpp>
 #include <boost/assign/auto_size/ref_list_of.hpp>
 #include <boost/assign/auto_size/detail/expr.hpp>
-//#include <boost/assign/auto_size/reference_wrapper/conversion_traits.hpp>
-//#include <boost/assign/auto_size/chain/convert_range.hpp>
+#include <boost/assign/auto_size/reference_wrapper/conversion_traits.hpp>
 #include <boost/assign/auto_size/chain/chain_convert.hpp>
 //#include <boost/assign/auto_size/comparison_op/crtp.hpp>
 
-//#include <boost/assign/auto_size/check/ref_list_of_caller.hpp> // tmp
-
 #include <libs/assign/example/chain.h>
 
 void example_chain(std::ostream& os)
@@ -40,7 +37,6 @@
         BOOST_AUTO(tmp1,ref_list_of(a)(b)(c)(d));
         BOOST_AUTO(tmp2,ref_list_of(e)(f)(g)(h));
 
-/*
     boost::copy(
         chain_convert_r(tmp2)(ar4)(ar5),
         std::ostream_iterator<val_>(os," ")
@@ -75,7 +71,7 @@
    // boost::chain(tmp2,ar4)
    // )
    //);
-*/
+
         os << "<- " << std::endl;
     
 }

Modified: sandbox/statistics/detail/assign/libs/assign/src/main.cpp
==============================================================================
--- sandbox/statistics/detail/assign/libs/assign/src/main.cpp (original)
+++ sandbox/statistics/detail/assign/libs/assign/src/main.cpp 2010-03-19 01:13:48 EDT (Fri, 19 Mar 2010)
@@ -10,7 +10,7 @@
      using namespace boost::assign::detail::auto_size;
 
      check_ref_list_of<int>();
- // std::cout << "check_ref_list_of : ok" << std::endl;
+ std::cout << "check_ref_list_of : ok" << std::endl;
     // boost::assign::detail::auto_size::check_ref_csv<int>();
     // std::cout << "check_ref_csv : ok" << std::endl;
 


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