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) |
5 | |
6 | // See http://www.boost.org/libs/test for the library home page. |
7 | // |
8 | //! @file |
9 | //! Lexicographic comparison manipulator implementation |
10 | // *************************************************************************** |
11 | |
12 | #ifndef BOOST_TEST_TOOLS_DETAIL_LEXICOGRAPHIC_MANIP_HPP_050815GER |
13 | #define BOOST_TEST_TOOLS_DETAIL_LEXICOGRAPHIC_MANIP_HPP_050815GER |
14 | |
15 | // Boost Test |
16 | #include <boost/test/tools/detail/fwd.hpp> |
17 | #include <boost/test/tools/detail/indirections.hpp> |
18 | |
19 | #include <boost/test/tools/assertion.hpp> |
20 | #include <boost/test/tools/collection_comparison_op.hpp> |
21 | |
22 | #include <boost/test/detail/suppress_warnings.hpp> |
23 | |
24 | //____________________________________________________________________________// |
25 | |
26 | namespace boost { |
27 | namespace test_tools { |
28 | |
29 | // ************************************************************************** // |
30 | // ************** per element comparison manipulator ************** // |
31 | // ************************************************************************** // |
32 | |
33 | //! Lexicographic comparison manipulator, for containers |
34 | struct lexicographic {}; |
35 | |
36 | //____________________________________________________________________________// |
37 | |
38 | inline int |
39 | operator<<( unit_test::lazy_ostream const&, lexicographic ) { return 0; } |
40 | |
41 | //____________________________________________________________________________// |
42 | |
43 | namespace tt_detail { |
44 | |
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, lexicographic ) |
48 | { |
49 | typedef typename OP::elem_op elem_op; |
50 | return assertion::op::lexicographic_compare<elem_op>( ae.m_e.lhs().value(), ae.m_e.rhs() ); |
51 | } |
52 | |
53 | //____________________________________________________________________________// |
54 | |
55 | inline check_type |
56 | operator<<( assertion_type const&, lexicographic ) |
57 | { |
58 | return CHECK_BUILT_ASSERTION; |
59 | } |
60 | |
61 | //____________________________________________________________________________// |
62 | |
63 | } // namespace tt_detail |
64 | } // namespace test_tools |
65 | } // namespace boost |
66 | |
67 | #include <boost/test/detail/enable_warnings.hpp> |
68 | |
69 | #endif // BOOST_TEST_TOOLS_DETAIL_LEXICOGRAPHIC_MANIP_HPP_050815GER |
70 | |