|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r60719 - sandbox/statistics/detail/assign/boost/assign/auto_size/check
From: erwann.rogard_at_[hidden]
Date: 2010-03-19 19:41:08
Author: e_r
Date: 2010-03-19 19:41:08 EDT (Fri, 19 Mar 2010)
New Revision: 60719
URL: http://svn.boost.org/trac/boost/changeset/60719
Log:
m
Added:
sandbox/statistics/detail/assign/boost/assign/auto_size/check/comparison_op.hpp (contents, props changed)
sandbox/statistics/detail/assign/boost/assign/auto_size/check/example2.hpp (contents, props changed)
Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/comparison_op.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/comparison_op.hpp 2010-03-19 19:41:08 EDT (Fri, 19 Mar 2010)
@@ -0,0 +1,66 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::check_comparison_op.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_COMPARISON_OP_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_COMPARISON_OP_ER_2010_HPP
+
+#ifndef BOOST_ASSIGN_CHECK_EQUAL
+#error
+#endif
+
+#define BOOST_ASSIGN_AS_CHECK_comparison_op \
+{ \
+ typedef T val_; \
+ using namespace check_constants; \
+ val_ a1 = 0, b1 = 1, c1 = 2; \
+ typedef boost::array<T,3> ar_; \
+ ar_ ar1; ar1[0] = a1; ar1[1] = b1; ar1[2] = c1; \
+ ar_ ar2; ar2[0] = a1; ar2[1] = b1; ar2[2] = c1; \
+ BOOST_AUTO(tmp1,BOOST_ASSIGN_AS_CHECK_cref3(a1,b1,c1)); \
+ BOOST_AUTO(tmp2,BOOST_ASSIGN_AS_CHECK_cref3(ar2[0],ar2[1],ar2[2])); \
+ BOOST_ASSIGN_CHECK_EQUAL( (ar1 == tmp2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 == ar2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 == tmp2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (ar1 != tmp2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 != ar2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 != tmp2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (ar1 > tmp2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 > ar2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 > tmp2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (ar1 < tmp2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 < ar2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 < tmp2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (ar1 <= tmp2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 <= ar2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 <= tmp2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (ar1 >= tmp2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 >= ar2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 >= tmp2), true ); \
+ ar2[1] = 2; \
+ BOOST_ASSIGN_CHECK_EQUAL( (ar1 == tmp2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 == ar2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 == tmp2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (ar1 != tmp2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 != ar2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 != tmp2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (ar1 > tmp2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 > ar2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 > tmp2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (ar1 < tmp2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 < ar2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 < tmp2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (ar1 <= tmp2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 <= ar2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 <= tmp2), true ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (ar1 >= tmp2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 >= ar2), false ); \
+ BOOST_ASSIGN_CHECK_EQUAL( (tmp1 >= tmp2), false ); \
+} \
+/**/
+
+#endif
\ No newline at end of file
Added: sandbox/statistics/detail/assign/boost/assign/auto_size/check/example2.hpp
==============================================================================
--- (empty file)
+++ sandbox/statistics/detail/assign/boost/assign/auto_size/check/example2.hpp 2010-03-19 19:41:08 EDT (Fri, 19 Mar 2010)
@@ -0,0 +1,46 @@
+//////////////////////////////////////////////////////////////////////////////
+// assign::detail::auto_size::check_example2.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_EXAMPLE2_ER_2010_HPP
+#define BOOST_ASSIGN_DETAIL_AUTO_SIZE_CHECK_EXAMPLE2_ER_2010_HPP
+#include <vector>
+#include <iterator>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/assign/auto_size/chain_convert.hpp>
+
+#define BOOST_ASSIGN_AS_CHECK_example2 \
+{ \
+ typedef T val_; \
+ std::vector<int> v, v2; \
+ v = BOOST_ASSIGN_AS_CHECK_cref3(1,2,3); \
+ boost::copy( \
+ chain_convert_r( \
+ BOOST_ASSIGN_AS_CHECK_cref1(0) \
+ )( v )( v )( BOOST_ASSIGN_AS_CHECK_cref1(4) ), \
+ std::back_inserter(v2) \
+ ); \
+ BOOST_ASSIGN_CHECK_EQUAL( v2.size() , 8u ); \
+ boost::copy( \
+ chain_convert_r(v2)(BOOST_ASSIGN_AS_CHECK_cref1(5)), \
+ std::back_inserter(v) \
+ ); \
+ BOOST_ASSIGN_CHECK_EQUAL( v.size() , 12u ); \
+ int x = 0; \
+ int y = 1; \
+ BOOST_ASSIGN_CHECK_EQUAL( \
+ boost::size( \
+ chain_convert_r( \
+ BOOST_ASSIGN_AS_CHECK_cref1( x ) \
+ )( v2 )( BOOST_ASSIGN_AS_CHECK_cref1( y ) ) \
+ ), \
+ 10u \
+ ); \
+} \
+/**/
+
+#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