1 // (C) Copyright Gennadiy Rozental 2001.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See http://www.boost.org/libs/test for the library home page.
9 //! Per element comparison manipulator implementation
10 // ***************************************************************************
12 #ifndef BOOST_TEST_TOOLS_DETAIL_PER_ELEMENT_MANIP_HPP_050815GER
13 #define BOOST_TEST_TOOLS_DETAIL_PER_ELEMENT_MANIP_HPP_050815GER
16 #include <boost/test/tools/detail/fwd.hpp>
17 #include <boost/test/tools/detail/indirections.hpp>
19 #include <boost/test/tools/assertion.hpp>
20 #include <boost/test/tools/collection_comparison_op.hpp>
22 #include <boost/test/detail/suppress_warnings.hpp>
24 //____________________________________________________________________________//
27 namespace test_tools {
29 // ************************************************************************** //
30 // ************** per element comparison manipulator ************** //
31 // ************************************************************************** //
33 //! Per element comparison manipulator, for containers
34 struct per_element {};
36 //____________________________________________________________________________//
39 operator<<( unit_test::lazy_ostream const&, per_element ) { return 0; }
41 //____________________________________________________________________________//
45 template<typename T1, typename T2, typename OP>
46 inline assertion_result
47 operator<<(assertion_evaluate_t<assertion::binary_expr<T1,T2,OP> > const& ae, per_element )
49 typedef typename OP::elem_op elem_op;
50 return assertion::op::element_compare<elem_op>( ae.m_e.lhs().value(), ae.m_e.rhs() );
53 //____________________________________________________________________________//
56 operator<<( assertion_type const&, per_element )
58 return CHECK_BUILT_ASSERTION;
61 //____________________________________________________________________________//
63 } // namespace tt_detail
64 } // namespace test_tools
67 #include <boost/test/detail/enable_warnings.hpp>
69 #endif // BOOST_TEST_TOOLS_DETAIL_PER_ELEMENT_MANIP_HPP_050815GER