Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60397 - sandbox/statistics/detail/assign/boost/assign/auto_size/check
From: erwann.rogard_at_[hidden]
Date: 2010-03-09 20:43:44


Author: e_r
Date: 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
New Revision: 60397
URL: http://svn.boost.org/trac/boost/changeset/60397

Log:
m
Added:
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/adapter.hpp (contents, props changed)
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/array.hpp (contents, props changed)
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/converter.hpp (contents, props changed)
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/copy_array.hpp (contents, props changed)
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/copy_iterator.hpp (contents, props changed)
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/fifo.hpp (contents, props changed)
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/iterator.hpp (contents, props changed)
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/lifo.hpp (contents, props changed)
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/max_element.hpp (contents, props changed)
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/rebind_array.hpp (contents, props changed)
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/ref_csv.hpp (contents, props changed)
   sandbox/statistics/detail/assign/boost/assign/auto_size/check/ref_list_of.hpp (contents, props changed)

Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/adapter.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/adapter.hpp 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
@@ -0,0 +1,48 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::check_adapter.hpp //
+// //
+// (C) Copyright 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_DETAIL_AUTO_SIZE_CHECK_ADAPTER_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_ADAPTER_ER_2010_HPP
+#include <stack>
+#include <queue>
+
+#ifndef BOOST_ASSIGN_CHECK_EQUAL
+#error
+#endif
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+ template<typename C1,typename T>
+ void check_adapter(std::queue<T>& elems,const C1& coll,
+ const T& a,const T& b,const T& c,const T& d,const T& e,const T& f,
+ const T& g,const T& h
+ )
+ {
+ check_fifo(elems,coll,a,b,c,d,e,f,g,h);
+ }
+
+ template<typename C1,typename T>
+ void check_adapter(std::stack<T>& elems,const C1& coll,
+ const T& a,const T& b,const T& c,const T& d,const T& e,const T& f,
+ const T& g,const T& h
+ )
+ {
+ check_lifo(elems,coll,a,b,c,d,e,f,g,h);
+ }
+
+ // Overload as needed
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/array.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/array.hpp 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
@@ -0,0 +1,53 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::check_array.hpp //
+// //
+// (C) Copyright 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_DETAIL_AUTO_SIZE_CHECK_ARRAY_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_ARRAY_ER_2010_HPP
+#include <boost/typeof/typeof.hpp>
+#include <boost/next_prior.hpp>
+#include <boost/range.hpp>
+
+
+#ifndef BOOST_ASSIGN_CHECK_EQUAL
+#error
+#endif
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+// Usage
+// check_array(list_of(a)(b)(c)(d)(e)(f)(g)(h),a,b,c,d,e,f,g,h);
+
+template<typename C1,typename T>
+void check_array(const C1& coll,
+ const T& a,const T& b,const T& c, const T& d,const T& e,const T& f,
+ const T& g,const T& h
+){
+ //BOOST_ASSIGN_CHECK_EQUAL( coll.size(), 8 );
+ BOOST_ASSIGN_CHECK_EQUAL( coll.empty() , false );
+ BOOST_ASSIGN_CHECK_EQUAL( coll[0] , a );
+ BOOST_ASSIGN_CHECK_EQUAL( coll[1] , b );
+ BOOST_ASSIGN_CHECK_EQUAL( coll[2] , c );
+ BOOST_ASSIGN_CHECK_EQUAL( coll[3] , d );
+ BOOST_ASSIGN_CHECK_EQUAL( coll[4] , e );
+ BOOST_ASSIGN_CHECK_EQUAL( coll[5] , f );
+ BOOST_ASSIGN_CHECK_EQUAL( coll[6] , g );
+ BOOST_ASSIGN_CHECK_EQUAL( coll[7] , h );
+ BOOST_ASSIGN_CHECK_EQUAL( coll.front() , a );
+ BOOST_ASSIGN_CHECK_EQUAL( coll.back() , h );
+}
+
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/converter.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/converter.hpp 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
@@ -0,0 +1,105 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::check_converter.hpp //
+// //
+// (C) Copyright 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_DETAIL_AUTO_SIZE_CHECK_CONVERTER_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_CONVERTER_ER_2010_HPP
+#include <set>
+#include <stdexcept>
+#include <boost/range.hpp>
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+// Usage:
+// check_converter(elems,list_of(a)(b)(c)(d)(e)(f)(g)(h),a,b,c,d,e,f,g,h)
+// These must not be a sorted sequence
+
+#ifndef BOOST_ASSIGN_CHECK_EQUAL
+#error
+#endif
+
+// fwd declare
+template<typename C,typename C2,typename T>
+void check_converter(
+ C& elems, const C2& coll,
+ const T& a, const T& b, const T& c, const T& d, const T& e, const T& f,
+ const T& g, const T& h, bool sorted = false
+);
+
+// Overload #1
+
+template<typename C2,typename T>
+void check_converter(
+ std::set<T>& elems, const C2& coll,
+ const T& a, const T& b, const T& c, const T& d, const T& e, const T& f,
+ const T& g, const T& h
+){
+ check_converter(elems,coll,a,b,c,d,e,f,g,h,true);
+}
+
+// Generic implementation
+
+template<typename C,typename C2,typename T>
+void check_converter(
+ C& elems, const C2& coll,
+ const T& a, const T& b, const T& c, const T& d, const T& e, const T& f,
+ const T& g, const T& h, bool sorted = false
+){
+
+ if( (a<=b) && (b<=c) && (c<=d) && (d<=e) && (e<=f) && (f<=g) && (g<=h) ){
+ throw std::runtime_error(
+ "check_converter expects a non-sorterd sequence"
+ );
+ }
+
+ using namespace boost::assign;
+ elems = coll;
+ typedef typename boost::range_iterator<const C>::type it_;
+ it_ it = boost::begin(elems);
+ if(!sorted){
+ BOOST_ASSIGN_CHECK_EQUAL(*it , a); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , b); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , c); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , d); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , e); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , f); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , g); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , h); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(it==it_(boost::end(elems)) ,true );
+ // Comparison operators
+ BOOST_ASSIGN_CHECK_EQUAL(elems == coll,true);
+ BOOST_ASSIGN_CHECK_EQUAL(elems >= coll,true);
+ BOOST_ASSIGN_CHECK_EQUAL(coll == elems,true);
+ BOOST_ASSIGN_CHECK_EQUAL(coll <= elems,true);
+ }else{
+ BOOST_ASSIGN_CHECK_EQUAL(*it , 0); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , 1); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , 2); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , 3); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , 4); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , 5); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , 7); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(*it , 9); ++it;
+ BOOST_ASSIGN_CHECK_EQUAL(it==it_(boost::end(elems)) ,true );
+ // Comparison operators
+ BOOST_ASSIGN_CHECK_EQUAL(elems != coll,true);
+ BOOST_ASSIGN_CHECK_EQUAL(elems < coll, true);
+ BOOST_ASSIGN_CHECK_EQUAL(coll != elems,true);
+ BOOST_ASSIGN_CHECK_EQUAL(coll > elems, true);
+ }
+
+}
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/copy_array.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/copy_array.hpp 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
@@ -0,0 +1,60 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::copy_array.hpp //
+// //
+// (C) Copyright 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_DETAIL_AUTO_SIZE_CHECK_COPY_ARRAY_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_COPY_ARRAY_ER_2010_HPP
+#include <algorithm>
+#include <boost/range.hpp>
+
+#ifndef BOOST_ASSIGN_CHECK_EQUAL
+#error
+#endif
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+// Usage
+// BOOST_AUTO(tmp1,ref_list_of(a)(b)(c));
+// BOOST_AUTO(tmp2,ref_list_of(d)(e)(f));
+// check_copy_array(tmp1,tmp2,a,b,c,d,e,f);
+
+template<typename C,typename C1,typename T>
+void check_copy_array(C& coll,C1& coll1,
+ T& a, T& b, T& c,
+ T& d, T& e, T& f
+){
+ // Ensures that they are different
+ const T a1 = 1, b1 = 5, c1 = 3,
+ d1 = 4, e1 = 2, f1 = 9;
+ a = a1;
+ b = b1;
+ c = c1;
+ d = d1;
+ e = e1;
+ f = f1;
+ coll.swap(coll1);
+ BOOST_ASSIGN_CHECK_EQUAL( a , d1 );
+ BOOST_ASSIGN_CHECK_EQUAL( b , e1 );
+ BOOST_ASSIGN_CHECK_EQUAL( c , f1 );
+ BOOST_ASSIGN_CHECK_EQUAL( d , a1 );
+ BOOST_ASSIGN_CHECK_EQUAL( e , b1 );
+ BOOST_ASSIGN_CHECK_EQUAL( f , c1 );
+ coll.assign(0);
+ BOOST_ASSIGN_CHECK_EQUAL( a , 0 );
+ BOOST_ASSIGN_CHECK_EQUAL( b , 0 );
+ BOOST_ASSIGN_CHECK_EQUAL( c , 0 );
+}
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/copy_iterator.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/copy_iterator.hpp 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
@@ -0,0 +1,62 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::copy_iterator.hpp //
+// //
+// (C) Copyright 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_DETAIL_AUTO_SIZE_CHECK_COPY_ITERATOR_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_COPY_ITERATOR_ER_2010_HPP
+#include <algorithm>
+#include <boost/range.hpp>
+
+#ifndef BOOST_ASSIGN_CHECK_EQUAL
+#error
+#endif
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+// Usage
+// BOOST_AUTO(tmp,ref_list_of(a)(b)(c)(d)(e)(f)(g)(h))
+// check_iterator(tmp,a,b,c,d,e,f,g,h)
+
+template<typename C,typename T>
+void check_copy_iterator(C& coll,
+ // TODO: I guess these can be const
+ T& a, T& b, T& c, T& d, T& e, T& f,
+ T& g, T& h
+){
+ const T
+ a1 = 1, b1 = 5, c1 = 3,
+ d1 = 4, e1 = 2, f1 = 9,
+ g1 = 0, h1 = 7;
+ boost::array<T,8> ar;
+ ar[0] = a1;
+ ar[1] = b1;
+ ar[2] = c1;
+ ar[3] = d1;
+ ar[4] = e1;
+ ar[5] = f1;
+ ar[6] = g1;
+ ar[7] = h1;
+ std::copy(boost::begin(ar),boost::end(ar),boost::begin(coll));
+ BOOST_ASSIGN_CHECK_EQUAL(a , a1);
+ BOOST_ASSIGN_CHECK_EQUAL(b , b1);
+ BOOST_ASSIGN_CHECK_EQUAL(c , c1);
+ BOOST_ASSIGN_CHECK_EQUAL(d , d1);
+ BOOST_ASSIGN_CHECK_EQUAL(e , e1);
+ BOOST_ASSIGN_CHECK_EQUAL(f , f1);
+ BOOST_ASSIGN_CHECK_EQUAL(g , g1);
+ BOOST_ASSIGN_CHECK_EQUAL(h , h1);
+}
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/fifo.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/fifo.hpp 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
@@ -0,0 +1,46 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::check_fifo.hpp //
+// //
+// (C) Copyright 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_DETAIL_AUTO_SIZE_CHECK_FIFO_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_FIFO_ER_2010_HPP
+#include <set>
+#include <stdexcept>
+
+#ifndef BOOST_ASSIGN_CHECK_EQUAL
+#error
+#endif
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+ template<typename C,typename C1,typename T>
+ void check_fifo(C& elems,const C1& coll,
+ const T& a,const T& b,const T& c,const T& d,const T& e,const T& f,
+ const T& g,const T& h
+ )
+ {
+ elems = coll.to_adapter();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.front() , a); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.front() , b); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.front() , c); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.front() , d); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.front() , e); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.front() , f); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.front() , g); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.front() , h); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.empty() , true);
+ }
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/iterator.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/iterator.hpp 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
@@ -0,0 +1,51 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::check_iterator.hpp //
+// //
+// (C) Copyright 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_DETAIL_AUTO_SIZE_CHECK_ITERATOR_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_ITERATOR_ER_2010_HPP
+#include <boost/typeof/typeof.hpp>
+#include <boost/next_prior.hpp>
+#include <boost/range.hpp>
+
+
+#ifndef BOOST_ASSIGN_CHECK_EQUAL
+#error
+#endif
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+// Usage
+// check_iterator(list_of(a)(b)(c)(d)(e)(f)(g)(h),a,b,c,d,e,f,g,h);
+
+template<typename C1,typename T>
+void check_iterator(const C1& coll,
+ const T& a,const T& b,const T& c, const T& d,const T& e,const T& f,
+ const T& g,const T& h
+){
+ BOOST_AUTO(it,boost::begin(coll));
+ BOOST_ASSIGN_CHECK_EQUAL(*boost::next(it,0), a);
+ BOOST_ASSIGN_CHECK_EQUAL(*boost::next(it,1), b);
+ BOOST_ASSIGN_CHECK_EQUAL(*boost::next(it,2), c);
+ BOOST_ASSIGN_CHECK_EQUAL(*boost::next(it,3), d);
+ BOOST_ASSIGN_CHECK_EQUAL(*boost::next(it,4), e);
+ BOOST_ASSIGN_CHECK_EQUAL(*boost::next(it,5), f);
+ BOOST_ASSIGN_CHECK_EQUAL(*boost::next(it,6), g);
+ BOOST_ASSIGN_CHECK_EQUAL(*boost::next(it,7), h);
+ BOOST_ASSIGN_CHECK_EQUAL(boost::next(it,8), boost::end(coll));
+}
+
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/lifo.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/lifo.hpp 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
@@ -0,0 +1,46 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::check_lifo.hpp //
+// //
+// (C) Copyright 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_DETAIL_AUTO_SIZE_CHECK_LIFO_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_LIFO_ER_2010_HPP
+#include <set>
+#include <stdexcept>
+
+#ifndef BOOST_ASSIGN_CHECK_EQUAL
+#error
+#endif
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+ template<typename C,typename C1,typename T>
+ void check_lifo(C& elems,const C1& coll,
+ const T& a,const T& b,const T& c,const T& d,const T& e,const T& f,
+ const T& g,const T& h
+ )
+ {
+ elems = coll.to_adapter();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.top() , h); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.top() , g); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.top() , f); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.top() , e); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.top() , d); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.top() , c); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.top() , b); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.top() , a); elems.pop();
+ BOOST_ASSIGN_CHECK_EQUAL(elems.empty() , true);
+ }
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/max_element.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/max_element.hpp 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
@@ -0,0 +1,35 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::max_element.hpp //
+// //
+// (C) Copyright 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_DETAIL_AUTO_SIZE_CHECK_MAX_ELEMENT_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_MAX_ELEMENT_ER_2010_HPP
+#include <algorithm>
+#include <boost/range.hpp>
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+
+// This function will be superseded by boost::max_element from range_ex
+
+template< class Range >
+typename boost::range_iterator<const Range>::type
+max_element( const Range& r )
+{
+ return std::max_element( r.begin(), r.end() );
+}
+
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/rebind_array.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/rebind_array.hpp 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
@@ -0,0 +1,65 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::rebind_array.hpp //
+// //
+// (C) Copyright 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_DETAIL_AUTO_SIZE_CHECK_REBIND_ARRAY_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_REBIND_ARRAY_ER_2010_HPP
+
+#ifndef BOOST_ASSIGN_CHECK_EQUAL
+#error
+#endif
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+// Usage
+// BOOST_AUTO(tmp1,ref_rebind_list_of(a)(b)(c));
+// BOOST_AUTO(tmp2,ref_rebind_list_of(d)(e)(f));
+// check_rebind_array(tmp1,tmp2,a,b,c,d,e,f);
+
+template<typename C,typename C1,typename T>
+void check_rebind_array(C& coll,C1& coll1,
+ T& a, T& b, T& c,
+ T& d, T& e, T& f
+){
+ const T a1 = 1, b1 = 5, c1 = 3,
+ d1 = 4, e1 = 2, f1 = 9;
+ a = a1;
+ b = b1;
+ c = c1;
+ d = d1;
+ e = e1;
+ f = f1;
+ BOOST_ASSIGN_CHECK_EQUAL( coll[0] , a1 );
+ BOOST_ASSIGN_CHECK_EQUAL( coll[1] , b1 );
+ BOOST_ASSIGN_CHECK_EQUAL( coll[2] , c1 );
+ BOOST_ASSIGN_CHECK_EQUAL( coll1[0] , d1 );
+ BOOST_ASSIGN_CHECK_EQUAL( coll1[1] , e1 );
+ BOOST_ASSIGN_CHECK_EQUAL( coll1[2] , f1 );
+ coll.swap(coll1);
+ BOOST_ASSIGN_CHECK_EQUAL( coll[0] , d1 );
+ BOOST_ASSIGN_CHECK_EQUAL( coll[1] , e1 );
+ BOOST_ASSIGN_CHECK_EQUAL( coll[2] , f1 );
+ BOOST_ASSIGN_CHECK_EQUAL( coll1[0] , a1 );
+ BOOST_ASSIGN_CHECK_EQUAL( coll1[1] , b1 );
+ BOOST_ASSIGN_CHECK_EQUAL( coll1[2] , c1 );
+ BOOST_ASSIGN_CHECK_EQUAL( a , a1 );
+ BOOST_ASSIGN_CHECK_EQUAL( b , b1 );
+ BOOST_ASSIGN_CHECK_EQUAL( c , c1 );
+ BOOST_ASSIGN_CHECK_EQUAL( d , d1 );
+ BOOST_ASSIGN_CHECK_EQUAL( e , e1 );
+ BOOST_ASSIGN_CHECK_EQUAL( f , f1 );
+}
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif

Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/ref_csv.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/ref_csv.hpp 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
@@ -0,0 +1,146 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::check_ref_csv.hpp //
+// //
+// (C) Copyright 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_DETAIL_AUTO_SIZE_CHECK_REF_CSV_OF_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_REF_CSV_OF_ER_2010_HPP
+#include <vector>
+#include <set>
+#include <list>
+#include <stack>
+#include <queue>
+#include <boost/array.hpp>
+#include <boost/assign/auto_size/ref_csv.hpp>
+#include <boost/assign/auto_size/ref_rebind_csv.hpp>
+
+#include <boost/assign/auto_size/check/array.hpp>
+#include <boost/assign/auto_size/check/adapter.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/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>
+
+// Until range_ex avail.
+#include <boost/assign/auto_size/check/max_element.hpp>
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+template<typename T>
+void check_ref_csv()
+{
+ typedef T val_;
+ using namespace boost::assign;
+ const val_
+ a1 = 1, b1 = 5, c1 = 3,
+ d1 = 4, e1 = 2, f1 = 9,
+ g1 = 0, h1 = 7;
+
+ {
+ // ---- Examples in the documentation
+ val_ a=a1, b=b1, c=c1, d=d1, e=e1, f=f1, g=g1, h=h1;
+ val_& max = *max_element( ref_csv(a,b,c,d,e,f,g,h) );
+ BOOST_ASSERT( max == f );
+ max = 8;
+ BOOST_ASSERT( f == 8 );
+ const val_& const_max = *max_element(
+ cref_csv(1,5,3,d,e,f,g,h) );
+ BOOST_ASSERT( max == const_max );
+ }
+ {
+ check_iterator(
+ cref_csv(a1,b1,c1,d1,e1,f1,g1,h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ check_array(
+ cref_csv(a1,b1,c1,d1,e1,f1,g1,h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ val_ a, b, c, d, e, f, g, h;
+ BOOST_AUTO(tmp,ref_csv(a,b,c,d,e,f,g,h));
+ check_copy_iterator(
+ tmp,
+ a,b,c,d,e,f,g,h);
+ }
+ {
+ val_ a, b, c, d, e, f;
+ BOOST_AUTO(tmp1,ref_csv(a,b,c));
+ BOOST_AUTO(tmp2,ref_csv(d,e,f));
+ check_copy_array(
+ tmp1,tmp2,
+ a,b,c,d,e,f);
+ }
+ {
+ val_ a, b, c, d, e, f;
+ BOOST_AUTO(tmp1,ref_rebind_csv(a,b,c));
+ BOOST_AUTO(tmp2,ref_rebind_csv(d,e,f));
+ check_rebind_array(
+ tmp1,
+ tmp2,
+ a,b,c,d,e,f);
+ }
+ {
+ std::list<val_> elems;
+ check_converter(
+ elems,
+ ref_csv(a1,b1,c1,d1,e1,f1,g1,h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ std::vector<val_> elems;
+ check_converter(
+ elems,
+ ref_csv(a1,b1,c1,d1,e1,f1,g1,h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ boost::array<val_,8> elems;
+ check_converter(
+ elems,
+ ref_csv(a1,b1,c1,d1,e1,f1,g1,h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ std::set<val_> elems;
+ check_converter(
+ elems,
+ ref_csv(a1,b1,c1,d1,e1,f1,g1,h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ std::stack<val_> elems;
+ check_adapter(
+ elems,
+ ref_csv(a1,b1,c1,d1,e1,f1,g1,h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ std::queue<val_> elems;
+ check_adapter(
+ elems,
+ ref_csv(a1,b1,c1,d1,e1,f1,g1,h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+
+}
+
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#endif
+
+

Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/ref_list_of.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/ref_list_of.hpp 2010-03-09 20:43:42 EST (Tue, 09 Mar 2010)
@@ -0,0 +1,146 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::check_ref_list_of.hpp //
+// //
+// (C) Copyright 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_DETAIL_AUTO_SIZE_CHECK_REF_LIST_OF_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_REF_LIST_OF_ER_2010_HPP
+#include <vector>
+#include <set>
+#include <list>
+#include <stack>
+#include <queue>
+#include <boost/array.hpp>
+#include <boost/assign/auto_size/ref_list_of.hpp>
+#include <boost/assign/auto_size/ref_rebind_list_of.hpp>
+
+#include <boost/assign/auto_size/check/array.hpp>
+#include <boost/assign/auto_size/check/adapter.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/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>
+
+// Until range_ex avail.
+#include <boost/assign/auto_size/check/max_element.hpp>
+
+namespace boost{
+namespace assign{
+namespace detail{
+namespace auto_size{
+
+template<typename T>
+void check_ref_list_of()
+{
+ typedef T val_;
+ using namespace boost::assign;
+ const val_
+ a1 = 1, b1 = 5, c1 = 3,
+ d1 = 4, e1 = 2, f1 = 9,
+ g1 = 0, h1 = 7;
+
+ {
+ // ---- Examples in the documentation
+ val_ a=a1, b=b1, c=c1, d=d1, e=e1, f=f1, g=g1, h=h1;
+ val_& max = *max_element( ref_list_of(a)(b)(c)(d)(e)(f)(g)(h) );
+ BOOST_ASSIGN_CHECK_EQUAL( max , f );
+ max = 8;
+ BOOST_ASSIGN_CHECK_EQUAL( f , 8 );
+ const val_& const_max = *max_element(
+ cref_list_of(1)(5)(3)(d)(e)(f)(g)(h) );
+ BOOST_ASSIGN_CHECK_EQUAL( max , const_max );
+ }
+ {
+ check_iterator(
+ cref_list_of(a1)(b1)(c1)(d1)(e1)(f1)(g1)(h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ check_array(
+ cref_list_of(a1)(b1)(c1)(d1)(e1)(f1)(g1)(h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ val_ a, b, c, d, e, f, g, h;
+ BOOST_AUTO(tmp,ref_list_of(a)(b)(c)(d)(e)(f)(g)(h));
+ check_copy_iterator(
+ tmp,
+ a,b,c,d,e,f,g,h);
+ }
+ {
+ val_ a, b, c, d, e, f;
+ BOOST_AUTO(tmp1,ref_list_of(a)(b)(c));
+ BOOST_AUTO(tmp2,ref_list_of(d)(e)(f));
+ check_copy_array(
+ tmp1,tmp2,
+ a,b,c,d,e,f);
+ }
+ {
+ val_ a, b, c, d, e, f;
+ BOOST_AUTO(tmp1,ref_rebind_list_of(a)(b)(c));
+ BOOST_AUTO(tmp2,ref_rebind_list_of(d)(e)(f));
+ check_rebind_array(
+ tmp1,
+ tmp2,
+ a,b,c,d,e,f);
+ }
+ {
+ std::list<val_> elems;
+ check_converter(
+ elems,
+ ref_list_of(a1)(b1)(c1)(d1)(e1)(f1)(g1)(h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ std::vector<val_> elems;
+ check_converter(
+ elems,
+ ref_list_of(a1)(b1)(c1)(d1)(e1)(f1)(g1)(h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ boost::array<val_,8> elems;
+ check_converter(
+ elems,
+ ref_list_of(a1)(b1)(c1)(d1)(e1)(f1)(g1)(h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ std::set<val_> elems;
+ check_converter(
+ elems,
+ ref_list_of(a1)(b1)(c1)(d1)(e1)(f1)(g1)(h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ std::stack<val_> elems;
+ check_adapter(
+ elems,
+ ref_list_of(a1)(b1)(c1)(d1)(e1)(f1)(g1)(h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+ {
+ std::queue<val_> elems;
+ check_adapter(
+ elems,
+ ref_list_of(a1)(b1)(c1)(d1)(e1)(f1)(g1)(h1),
+ a1,b1,c1,d1,e1,f1,g1,h1);
+ }
+
+}
+
+
+}// auto_size
+}// detail
+}// assign
+}// boost
+
+#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