Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81243 - in trunk/boost/test: . data data/monomorphic impl tools utils
From: gennadiy.rozental_at_[hidden]
Date: 2012-11-08 02:06:32


Author: rogeeff
Date: 2012-11-08 02:06:30 EST (Thu, 08 Nov 2012)
New Revision: 81243
URL: http://svn.boost.org/trac/boost/changeset/81243

Log:
support for collection comparison using BOOST_TEST tool
Added:
   trunk/boost/test/utils/is_forward_iterable.hpp (contents, props changed)
Text files modified:
   trunk/boost/test/data/config.hpp | 2
   trunk/boost/test/data/monomorphic/collection.hpp | 2
   trunk/boost/test/data/monomorphic/fwd.hpp | 27 --
   trunk/boost/test/data/monomorphic/singleton.hpp | 2
   trunk/boost/test/impl/test_tools.ipp | 8
   trunk/boost/test/test_tools.hpp | 7
   trunk/boost/test/tools/assertion.hpp | 416 ++++++++++++++++++++++-----------------
   7 files changed, 254 insertions(+), 210 deletions(-)

Modified: trunk/boost/test/data/config.hpp
==============================================================================
--- trunk/boost/test/data/config.hpp (original)
+++ trunk/boost/test/data/config.hpp 2012-11-08 02:06:30 EST (Thu, 08 Nov 2012)
@@ -1,4 +1,4 @@
-// (C) Copyright Gennadiy Rozental 2011-2012.
+// (C) Copyright Gennadiy Rozental 2011-2012. JIM
 // Distributed under 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)

Modified: trunk/boost/test/data/monomorphic/collection.hpp
==============================================================================
--- trunk/boost/test/data/monomorphic/collection.hpp (original)
+++ trunk/boost/test/data/monomorphic/collection.hpp 2012-11-08 02:06:30 EST (Thu, 08 Nov 2012)
@@ -85,7 +85,7 @@
 } // namespace monomorphic
 
 template<typename C>
-inline monomorphic::collection<typename std::enable_if<ds_detail::is_std_collection<C>::value,C>::type>
+inline monomorphic::collection<typename std::enable_if<is_forward_iterable<C>::value,C>::type>
 make( C&& c )
 {
     return monomorphic::collection<C>( std::forward<C>(c) );

Modified: trunk/boost/test/data/monomorphic/fwd.hpp
==============================================================================
--- trunk/boost/test/data/monomorphic/fwd.hpp (original)
+++ trunk/boost/test/data/monomorphic/fwd.hpp 2012-11-08 02:06:30 EST (Thu, 08 Nov 2012)
@@ -19,6 +19,8 @@
 #include <boost/test/data/config.hpp>
 #include <boost/test/data/size.hpp>
 
+#include <boost/test/utils/is_forward_iterable.hpp>
+
 // Boost
 #include <boost/utility/declval.hpp>
 
@@ -34,29 +36,6 @@
 namespace unit_test {
 namespace data {
 
-// ************************************************************************** //
-// ************** is_std_collection ************** //
-// ************************************************************************** //
-
-namespace ds_detail {
-
-template<typename T>
-struct is_std_collection : std::false_type {};
-
-template<typename T>
-struct is_std_collection<T const> : is_std_collection<T> {};
-
-template<typename T>
-struct is_std_collection<T&> : is_std_collection<T> {};
-
-template<typename T>
-struct is_std_collection<std::vector<T>> : std::true_type {};
-
-template<typename T>
-struct is_std_collection<std::list<T>> : std::true_type {};
-
-} // namespace ds_detail
-
 namespace monomorphic {
 
 template<typename T>
@@ -109,7 +88,7 @@
 //____________________________________________________________________________//
 
 template<typename T>
-inline typename std::enable_if<!ds_detail::is_std_collection<T>::value &&
+inline typename std::enable_if<!is_forward_iterable<T>::value &&
                                !monomorphic::is_dataset<T>::value,
                                monomorphic::singleton<T> >::type
 make( T&& v );

Modified: trunk/boost/test/data/monomorphic/singleton.hpp
==============================================================================
--- trunk/boost/test/data/monomorphic/singleton.hpp (original)
+++ trunk/boost/test/data/monomorphic/singleton.hpp 2012-11-08 02:06:30 EST (Thu, 08 Nov 2012)
@@ -81,7 +81,7 @@
 } // namespace monomorphic
 
 template<typename T>
-inline typename std::enable_if<!ds_detail::is_std_collection<T>::value &&
+inline typename std::enable_if<!is_forward_iterable<T>::value &&
                                !monomorphic::is_dataset<T>::value,
                                monomorphic::singleton<T> >::type
 make( T&& v )

Modified: trunk/boost/test/impl/test_tools.ipp
==============================================================================
--- trunk/boost/test/impl/test_tools.ipp (original)
+++ trunk/boost/test/impl/test_tools.ipp 2012-11-08 02:06:30 EST (Thu, 08 Nov 2012)
@@ -140,8 +140,12 @@
         if( tl != PASS ) {
             const_string details_message = pr.message();
 
- if( !details_message.is_empty() )
- os << " [" << pr.message() << "]" ;
+ if( !details_message.is_empty() ) {
+ if( first_char( details_message ) != '\n' )
+ os << " [" << details_message << "]" ;
+ else
+ os << "." << details_message;
+ }
         }
         break;
 

Modified: trunk/boost/test/test_tools.hpp
==============================================================================
--- trunk/boost/test/test_tools.hpp (original)
+++ trunk/boost/test/test_tools.hpp 2012-11-08 02:06:30 EST (Thu, 08 Nov 2012)
@@ -101,10 +101,17 @@
 
 //____________________________________________________________________________//
 
+#if BOOST_NO_CXX11_AUTO_DECLARATIONS
 #define BOOST_TEST_BUILD_ASSERTION( P ) \
     ::boost::test_tools::assertion::expression const& E = \
     ::boost::test_tools::assertion::seed() ->* P; \
 /**/
+#else
+#define BOOST_TEST_BUILD_ASSERTION( P ) \
+ auto const& E = \
+ ::boost::test_tools::assertion::seed() ->* P; \
+/**/
+#endif
 
 #define BOOST_WARN_ASSERTION( P ) BOOST_TEST_TOOL_IMPL( 2, \
     (E.evaluate()), BOOST_TEST_TOOLS_STRINGIZE( P ), WARN, \

Modified: trunk/boost/test/tools/assertion.hpp
==============================================================================
--- trunk/boost/test/tools/assertion.hpp (original)
+++ trunk/boost/test/tools/assertion.hpp 2012-11-08 02:06:30 EST (Thu, 08 Nov 2012)
@@ -16,13 +16,16 @@
 #define BOOST_TEST_TOOLS_ASSERTION_HPP_100911GER
 
 // Boost.Test
+#include <boost/test/utils/is_forward_iterable.hpp>
 
 // Boost
 #include <boost/mpl/assert.hpp>
 #include <boost/utility/declval.hpp>
+#include <boost/utility/enable_if.hpp>
+#include <boost/type_traits/remove_reference.hpp>
 
 // STL
-#ifndef BOOST_NO_RVALUE_REFERENCES
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
 #include <utility>
 #endif
 
@@ -35,209 +38,246 @@
 namespace assertion {
 
 // ************************************************************************** //
-// ************** assertion::expression ************** //
-// ************************************************************************** //
-
-class expression {
-public:
- // expression interface
- virtual predicate_result evaluate() const = 0;
-};
-
-// ************************************************************************** //
 // ************** assertion::operators ************** //
 // ************************************************************************** //
+// precedence 4: ->*, .*
+// precedence 5: *, /, %
+// precedence 6: +, -
+// precedence 7: << , >>
+// precedence 8: <, <=, > and >=
+// precedence 9: == and !=
+// precedence 10: bitwise AND
+// precedence 11: bitwise XOR
+// precedence 12: bitwise OR
+// precedence 13: logical AND
+// disabled
+// precedence 14: logical OR
+// disabled
+// precedence 15: ternary conditional
+// disabled
+// precedence 16: = and OP= operators
+// precedence 17: throw operator
+// not supported
+// precedence 18: comma
+// not supported
 
 namespace op {
 
-enum id {
- // precedence 4: ->*, .*
- MEMP,
- // precedence 5: *, /, %
- MUL, DIV, MOD,
- // precedence 6: +, -
- ADD, SUB,
- // precedence 7: << , >>
- LSH, RSH,
- // precedence 8: <, <=, > and >=
- LT, LE, GT, GE,
- // precedence 9: == and !=
- EQ, NE,
- // precedence 10: bitwise AND
- BAND,
- // precedence 11: bitwise XOR
- XOR,
- // precedence 12: bitwise OR
- BOR,
- // precedence 13: logical AND
- // disabled
- // precedence 14: logical OR
- // disabled
- // precedence 15: ternary conditional
- // disabled
-
- // precedence 16: = and OP= operators
- SET, IADD, ISUB, IMUL, IDIV, IMOD,
- ILSH, IRSH,
- IAND, IXOR, IOR
- // precedence 17: throw operator
- // not supported
- // precedence 18: comma
- // not supported
-};
+#define BOOST_TEST_FOR_EACH_COMP_OP(action) \
+ action( < , LT, >= ) \
+ action( <=, LE, > ) \
+ action( > , GT, <= ) \
+ action( >=, GE, < ) \
+ action( ==, EQ, != ) \
+ action( !=, NE, == ) \
+/**/
 
-#ifndef BOOST_NO_DECLTYPE
+//____________________________________________________________________________//
 
-#define BOOST_TEST_FOR_EACH_OP( action ) \
- action(->*, MEMP ) \
- \
- action( * , MUL ) \
- action( / , DIV ) \
- action( % , MOD ) \
+#ifndef BOOST_NO_CXX11_DECLTYPE
+
+#define BOOST_TEST_FOR_EACH_CONST_OP(action)\
+ action(->*, MEMP, ->* ) \
                                             \
- action( + , ADD ) \
- action( - , SUB ) \
+ action( * , MUL, * ) \
+ action( / , DIV, / ) \
+ action( % , MOD, % ) \
                                             \
- action( <<, LSH ) \
- action( >>, RSH ) \
+ action( + , ADD, + ) \
+ action( - , SUB, - ) \
                                             \
- action( < , LT ) \
- action( <=, LE ) \
- action( > , GT ) \
- action( >=, GE ) \
+ action( <<, LSH, << ) \
+ action( >>, RSH, >> ) \
                                             \
- action( ==, EQ ) \
- action( !=, NE ) \
+ BOOST_TEST_FOR_EACH_COMP_OP(action) \
                                             \
- action( & , BAND ) \
- action( ^ , XOR ) \
- action( | , BOR ) \
+ action( & , BAND, & ) \
+ action( ^ , XOR, ^ ) \
+ action( | , BOR, | ) \
 /**/
 
 #else
 
-#define BOOST_TEST_FOR_EACH_OP( action ) \
- action( < , LT ) \
- action( <=, LE ) \
- action( > , GT ) \
- action( >=, GE ) \
- \
- action( ==, EQ ) \
- action( !=, NE ) \
+#define BOOST_TEST_FOR_EACH_CONST_OP(action)\
+ BOOST_TEST_FOR_EACH_COMP_OP(action) \
 /**/
 
 #endif
 
-#define BOOST_TEST_FOR_EACH_MUT_OP( action )\
- action( = , SET ) \
- action( +=, IADD ) \
- action( -=, ISUB ) \
- action( *=, IMUL ) \
- action( /=, IDIV ) \
- action( %=, IMOD ) \
- action(<<=, ILSH ) \
- action(>>=, IRSH ) \
- action( &=, IAND ) \
- action( ^=, IXOR ) \
- action( |=, IOR ) \
+//____________________________________________________________________________//
+
+#define BOOST_TEST_FOR_EACH_MUT_OP(action) \
+ action( = , SET , = ) \
+ action( +=, IADD, += ) \
+ action( -=, ISUB, -= ) \
+ action( *=, IMUL, *= ) \
+ action( /=, IDIV, /= ) \
+ action( %=, IMOD, %= ) \
+ action(<<=, ILSH, <<=) \
+ action(>>=, IRSH, >>=) \
+ action( &=, IAND, &= ) \
+ action( ^=, IXOR, ^= ) \
+ action( |=, IOR , |= ) \
 /**/
 
-// ************************************************************************** //
-// ************** assertion::operator traits ************** //
-// ************************************************************************** //
+//____________________________________________________________________________//
 
-template<id ID>
-struct traits {
- static char const* reverse( char const* direct ) { return direct; }
-};
+#ifndef BOOST_NO_CXX11_DECLTYPE
+# define DEDUCE_RESULT_TYPE( oper ) typename boost::remove_reference<decltype(boost::declval<Lhs>() oper boost::declval<Rhs>() )>::type
+#else
+# define DEDUCE_RESULT_TYPE( oper ) bool
+#endif
 
-template<> struct traits<EQ> { static char const* reverse( char const* ) { return "!="; } };
-template<> struct traits<NE> { static char const* reverse( char const* ) { return "=="; } };
+#define DEFINE_CONST_OPER( oper, name, rev ) \
+template<typename Lhs, typename Rhs, \
+ typename Enabler=void> \
+struct name { \
+ typedef DEDUCE_RESULT_TYPE( oper ) result_type; \
+ \
+ static result_type \
+ eval( Lhs const& lhs, Rhs const& rhs ) \
+ { \
+ return lhs oper rhs; \
+ } \
+ \
+ template<typename PrevExprType> \
+ static void \
+ report( std::ostream& ostr, \
+ PrevExprType const& lhs, \
+ Rhs const& rhs) \
+ { \
+ lhs.report( ostr ); \
+ ostr << revert() << rhs; \
+ } \
+ \
+ static char const* revert() \
+ { return " " #rev " "; } \
+}; \
+/**/
 
-template<> struct traits<LT> { static char const* reverse( char const* ) { return ">="; } };
-template<> struct traits<LE> { static char const* reverse( char const* ) { return ">"; } };
-template<> struct traits<GT> { static char const* reverse( char const* ) { return "<="; } };
-template<> struct traits<GE> { static char const* reverse( char const* ) { return "<"; } };
+BOOST_TEST_FOR_EACH_CONST_OP( DEFINE_CONST_OPER )
 
-} // anmespace op
+#undef DEDUCE_RESULT_TYPE
+#undef DEFINE_CONST_OPER
 
-// ************************************************************************** //
-// ************** assertion::expression_result ************** //
-// ************************************************************************** //
+//____________________________________________________________________________//
 
-namespace detail {
+template <typename OP, typename Lhs, typename Rhs>
+inline predicate_result
+compare_collections( Lhs const& lhs, Rhs const& rhs )
+{
+ predicate_result pr( true );
+
+ if( lhs.size() != rhs.size() ) {
+ pr = false;
+ pr.message() << "Collections size mismatch: " << lhs.size() << " != " << rhs.size();
+ return pr;
+ }
+
+ typename Lhs::const_iterator left = lhs.begin();
+ typename Rhs::const_iterator right = rhs.begin();
+ std::size_t pos = 0;
+
+ for( ; pos < lhs.size(); ++left, ++right, ++pos ) {
+ if( OP::eval( *left, *right ) )
+ continue;
 
-template<typename PrevExprType,typename Rhs,op::id OP>
-class expression_result;
+ pr = false;
+ pr.message() << "\nMismatch in a position " << pos << ": " << *left << OP::revert() << *right;
+ }
 
-#define DEFINE_OP_EXPRESSION_RESULT( OPER, ID ) \
-template<typename PrevExprType,typename Rhs> \
-class expression_result<PrevExprType,Rhs,op::ID> { \
- typedef typename PrevExprType::result_type Lhs; \
+ return pr;
+}
+
+//____________________________________________________________________________//
+
+#define DEFINE_COLLECTION_COMPARISON( oper, name, _ ) \
+template<typename Lhs,typename Rhs> \
+struct name<Lhs,Rhs,typename boost::enable_if_c< \
+unit_test::is_forward_iterable<Lhs>::value && \
+unit_test::is_forward_iterable<Rhs>::value>::type> { \
 public: \
+ typedef predicate_result result_type; \
                                                             \
- typedef DEDUCE_RESULT_TYPE( OPER ) type; \
- \
- static type \
- produce( Lhs const& lhs, Rhs const& rhs) \
+ static predicate_result \
+ eval( Lhs const& lhs, Rhs const& rhs) \
     { \
- return lhs OPER rhs; \
+ typedef name<typename boost::remove_reference<Lhs> \
+ ::type::value_type, \
+ typename boost::remove_reference<Rhs> \
+ ::type::value_type> elem_comp_op; \
+ return compare_collections<elem_comp_op>(lhs, rhs); \
     } \
                                                             \
+ template<typename PrevExprType> \
     static void \
- report( std::ostream& ostr, \
- PrevExprType const& lhs, Rhs const& rhs) \
- { \
- lhs.report( ostr ); \
- ostr << op::traits<op::ID>::reverse( #OPER ) \
- << rhs; \
- } \
+ report( std::ostream& ostr, \
+ PrevExprType const& lhs, \
+ Rhs const& rhs ) {} \
 }; \
 /**/
 
-////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_NO_DECLTYPE
-#define DEDUCE_RESULT_TYPE( OPER ) decltype(boost::declval<Lhs>() OPER boost::declval<Rhs>() )
-#else
-#define DEDUCE_RESULT_TYPE( OPER ) predicate_result
-#endif
-
-////////////////////////////////////////////////////////////////
+//____________________________________________________________________________//
 
-BOOST_TEST_FOR_EACH_OP( DEFINE_OP_EXPRESSION_RESULT )
+BOOST_TEST_FOR_EACH_COMP_OP( DEFINE_COLLECTION_COMPARISON )
 
-#undef DEDUCE_RESULT_TYPE
-#undef DEFINE_OP_EXPRESSION_RESULT
+} // namespace op
 
-} // namespace detail
+// ************************************************************************** //
+// ************** assertion::expression ************** //
+// ************************************************************************** //
 
-////////////////////////////////////////////////////////////////
+#if BOOST_NO_CXX11_AUTO_DECLARATIONS
+class expression {
+public:
+ // expression interface
+ virtual predicate_result evaluate() const = 0;
+};
+#endif
 
 // ************************************************************************** //
-// ************** assertion::expression_op ************** //
+// ************** assertion::expression_base ************** //
 // ************************************************************************** //
 // Defines expression operators
 
-template<typename Lhs,typename Rhs,op::id OP> class binary_expr;
+template<typename Lhs, typename Rhs, typename OP> class binary_expr;
 
-template<typename ExprType>
-class expression_op {
+template<typename ExprType,typename ValType>
+class expression_base
+#if BOOST_NO_CXX11_AUTO_DECLARATIONS
+: public expression
+#endif
+{
 public:
 
-#define ADD_OP_SUPPORT( OPER, ID ) \
- template<typename T> \
- binary_expr<ExprType,T,op::ID> \
- operator OPER( T const& rhs ) const \
- { \
- return binary_expr<ExprType,T,op::ID>( \
- *static_cast<ExprType const*>(this), \
- rhs ); \
- } \
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+
+#define ADD_OP_SUPPORT( oper, name, _ ) \
+ template<typename T> \
+ binary_expr<ExprType,T,op::name<ValType,T> > \
+ operator oper( T&& rhs ) const \
+ { \
+ return binary_expr<ExprType,T,op::name<ValType,T> >( \
+ *static_cast<ExprType const*>(this), \
+ std::forward<T>(rhs) ); \
+ } \
 /**/
+#else
 
- BOOST_TEST_FOR_EACH_OP( ADD_OP_SUPPORT )
-#undef ADD_OP_SUPPORT
+#define ADD_OP_SUPPORT( oper, name, _ ) \
+ template<typename T> \
+ binary_expr<ExprType,T,op::name<ValType,T> > \
+ operator oper( T const& rhs ) const \
+ { \
+ return binary_expr<ExprType,T,op::name<ValType,T> >( \
+ *static_cast<ExprType const*>(this), \
+ rhs ); \
+ } \
+/**/
+#endif
+
+ BOOST_TEST_FOR_EACH_CONST_OP( ADD_OP_SUPPORT )
+ #undef ADD_OP_SUPPORT
 
     // Disabled operators
     template<typename T>
@@ -272,13 +312,13 @@
 // simple value expression
 
 template<typename T>
-class value_expr : public expression, public expression_op<value_expr<T> > {
+class value_expr : public expression_base<value_expr<T>,T> {
 public:
     // Public types
     typedef T result_type;
 
     // Constructor
-#ifndef BOOST_NO_RVALUE_REFERENCES
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
     explicit value_expr( T&& val )
     : m_value( std::forward<T>(val) )
 #else
@@ -298,27 +338,26 @@
     }
 
     // Mutating operators
-#define ADD_OP_SUPPORT( OPER, ID ) \
- template<typename U> \
- value_expr<T>& \
- operator OPER( U const& rhs ) \
- { \
- m_value OPER rhs; \
- \
- return *this; \
- } \
+#define ADD_OP_SUPPORT( OPER, ID, _ ) \
+ template<typename U> \
+ value_expr<T>& \
+ operator OPER( U const& rhs ) \
+ { \
+ m_value OPER rhs; \
+ \
+ return *this; \
+ } \
 /**/
 
     BOOST_TEST_FOR_EACH_MUT_OP( ADD_OP_SUPPORT )
 #undef ADD_OP_SUPPORT
 
-private:
- template<typename U>
- static void format_message( wrap_stringstream& ostr, U const& v ) { ostr << "(bool)" << v << " is false"; }
- static void format_message( wrap_stringstream& ostr, bool v ) {}
-
     // expression interface
+#if BOOST_NO_CXX11_AUTO_DECLARATIONS
     virtual predicate_result evaluate() const
+#else
+ predicate_result evaluate() const
+#endif
     {
         predicate_result res( value() );
         if( !res )
@@ -327,41 +366,55 @@
         return res;
     }
 
+private:
+ template<typename U>
+ static void format_message( wrap_stringstream& ostr, U const& v ) { ostr << "(bool)" << v << " is false"; }
+ static void format_message( wrap_stringstream& ostr, bool v ) {}
+
     // Data members
     T m_value;
 };
 
 // ************************************************************************** //
-// ************** assertion::binary_expr_expr ************** //
+// ************** assertion::binary_expr ************** //
 // ************************************************************************** //
 // binary expression
 
-template<typename Lhs,typename Rhs,op::id OP>
-class binary_expr : public expression, public expression_op<binary_expr<Lhs,Rhs,OP> > {
- typedef detail::expression_result<Lhs,Rhs,OP> result;
+template<typename LExpr, typename Rhs, typename OP>
+class binary_expr : public expression_base<binary_expr<LExpr,Rhs,OP>,typename OP::result_type>
+{
 public:
     // Public types
- typedef typename result::type result_type;
+ typedef typename OP::result_type result_type;
 
     // Constructor
- binary_expr( Lhs const& lhs, Rhs const& rhs )
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
+ binary_expr( LExpr const& lhs, Rhs&& rhs )
+ : m_lhs( lhs )
+ , m_rhs( std::forward<Rhs>(rhs) )
+ {}
+#else
+ binary_expr( LExpr const& lhs, Rhs const&& rhs )
     : m_lhs( lhs )
     , m_rhs( rhs )
     {}
+#endif
 
- // Specifica expression interface
+ // Specific expression interface
     result_type value() const
     {
- return result::produce( m_lhs.value(), m_rhs );
+ return OP::eval( m_lhs.value(), m_rhs );
     }
     void report( std::ostream& ostr ) const
     {
- return result::report( ostr, m_lhs, m_rhs );
+ return OP::report( ostr, m_lhs, m_rhs );
     }
 
-private:
- // expression interface
+#if BOOST_NO_CXX11_AUTO_DECLARATIONS
     virtual predicate_result evaluate() const
+#else
+ predicate_result evaluate() const
+#endif
     {
         predicate_result res( value() );
         if( !res )
@@ -370,8 +423,9 @@
         return res;
     }
 
+private:
     // Data members
- Lhs m_lhs;
+ LExpr m_lhs;
     Rhs m_rhs;
 };
 
@@ -385,7 +439,7 @@
     // ->* is highest precedence left to right operator
     template<typename T>
     value_expr<T>
-#ifndef BOOST_NO_RVALUE_REFERENCES
+#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
     operator->*( T&& v ) const
     {
         return value_expr<T>( std::forward<T>( v ) );
@@ -399,7 +453,7 @@
 
 };
 
-#undef BOOST_TEST_FOR_EACH_OP
+#undef BOOST_TEST_FOR_EACH_CONST_OP
 
 } // namespace assertion
 } // namespace test_tools

Added: trunk/boost/test/utils/is_forward_iterable.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/test/utils/is_forward_iterable.hpp 2012-11-08 02:06:30 EST (Thu, 08 Nov 2012)
@@ -0,0 +1,52 @@
+// (C) Copyright Gennadiy Rozental 2012.
+// Distributed under 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision$
+//
+// Description : defines a special purpose type trait
+// ***************************************************************************
+
+#ifndef BOOST_TEST_IS_FRWARD_ITERABLE_HPP_110612GER
+#define BOOST_TEST_IS_FRWARD_ITERABLE_HPP_110612GER
+
+// Boost
+
+// STL
+#include <list>
+#include <vector>
+
+//____________________________________________________________________________//
+
+namespace boost {
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** is_forward_iterable ************** //
+// ************************************************************************** //
+
+template<typename T>
+struct is_forward_iterable : std::false_type {};
+
+template<typename T>
+struct is_forward_iterable<T const> : is_forward_iterable<T> {};
+
+template<typename T>
+struct is_forward_iterable<T&> : is_forward_iterable<T> {};
+
+template<typename T>
+struct is_forward_iterable<std::vector<T>> : std::true_type {};
+
+template<typename T>
+struct is_forward_iterable<std::list<T>> : std::true_type {};
+
+} // namespace unit_test
+} // namespace boost
+
+#endif // BOOST_TEST_IS_FRWARD_ITERABLE_HPP_110612GER
+


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