Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:52:40

0001 //  (C) Copyright Gennadiy Rozental 2001.
0002 //  Distributed under the Boost Software License, Version 1.0.
0003 //  (See accompanying file LICENSE_1_0.txt or copy at
0004 //  http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 //  See http://www.boost.org/libs/test for the library home page.
0007 //
0008 //! @file
0009 //! Lexicographic comparison manipulator implementation
0010 // ***************************************************************************
0011 
0012 #ifndef BOOST_TEST_TOOLS_DETAIL_LEXICOGRAPHIC_MANIP_HPP_050815GER
0013 #define BOOST_TEST_TOOLS_DETAIL_LEXICOGRAPHIC_MANIP_HPP_050815GER
0014 
0015 // Boost Test
0016 #include <boost/test/tools/detail/fwd.hpp>
0017 #include <boost/test/tools/detail/indirections.hpp>
0018 
0019 #include <boost/test/tools/assertion.hpp>
0020 #include <boost/test/utils/lazy_ostream.hpp>
0021 #include <boost/test/tools/collection_comparison_op.hpp>
0022 
0023 #include <ostream>
0024 
0025 #include <boost/test/detail/suppress_warnings.hpp>
0026 
0027 //____________________________________________________________________________//
0028 
0029 namespace boost {
0030 namespace test_tools {
0031 
0032 // ************************************************************************** //
0033 // **************      per element comparison manipulator      ************** //
0034 // ************************************************************************** //
0035 
0036 //! Lexicographic comparison manipulator, for containers
0037 //! This is a terminal that involves evaluation of the expression
0038 struct lexicographic {};
0039 
0040 //____________________________________________________________________________//
0041 
0042 inline unit_test::lazy_ostream&
0043 operator<<( unit_test::lazy_ostream & o, lexicographic )   { return o; }
0044 
0045 // needed for the lazy evaluation in lazy_ostream as lexicographic is a terminal
0046 inline std::ostream& 
0047 operator<<( std::ostream& o, lexicographic )               { return o; }
0048 
0049 //____________________________________________________________________________//
0050 
0051 namespace tt_detail {
0052 
0053 template<typename T1, typename T2, typename OP>
0054 inline assertion_result
0055 operator<<(assertion_evaluate_t<assertion::binary_expr<T1,T2,OP> > const& ae, lexicographic )
0056 {
0057     typedef typename OP::elem_op elem_op;
0058     return assertion::op::lexicographic_compare<elem_op>( ae.m_e.lhs().value(), ae.m_e.rhs() );
0059 }
0060 
0061 //____________________________________________________________________________//
0062 
0063 inline assertion_type
0064 operator<<( assertion_type const&, lexicographic )
0065 {
0066     return assertion_type(CHECK_BUILT_ASSERTION);
0067 }
0068 
0069 //____________________________________________________________________________//
0070 
0071 } // namespace tt_detail
0072 } // namespace test_tools
0073 } // namespace boost
0074 
0075 #include <boost/test/detail/enable_warnings.hpp>
0076 
0077 #endif // BOOST_TEST_TOOLS_DETAIL_LEXICOGRAPHIC_MANIP_HPP_050815GER