/*============================================================================= Copyright (c) 1999-2003 Jaakko Jarvi Copyright (c) 2001-2011 Joel de Guzman 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) ==============================================================================*/ #include #include struct not_a_fusion_container {}; template inline bool operator==(not_a_fusion_container, T const&) { return true; } template inline bool operator!=(not_a_fusion_container, T const&) { return true; } template inline bool operator<(not_a_fusion_container, T const&) { return true; } template inline bool operator<=(not_a_fusion_container, T const&) { return true; } template inline bool operator>(not_a_fusion_container, T const&) { return true; } template inline bool operator>=(not_a_fusion_container, T const&) { return true; } void equality_test() { using namespace boost::fusion; FUSION_SEQUENCE v1(5, 'a'); FUSION_SEQUENCE v2(5, 'a'); BOOST_TEST(v1 == v2); FUSION_SEQUENCE v3(5, 'b'); FUSION_SEQUENCE t4(2, 'a'); BOOST_TEST(v1 != v3); BOOST_TEST(v1 != t4); BOOST_TEST(!(v1 != v2)); FUSION_SEQUENCE v5(5, 'a', true); BOOST_TEST(v1 != v5); BOOST_TEST(!(v1 == v5)); BOOST_TEST(v5 != v1); BOOST_TEST(!(v5 == v1)); BOOST_TEST(not_a_fusion_container() == v1); BOOST_TEST(not_a_fusion_container() != v1); } void ordering_test() { using namespace boost::fusion; FUSION_SEQUENCE v1(4, 3.3f); FUSION_SEQUENCE v2(5, 3.3f); FUSION_SEQUENCE v3(5, 4.4); BOOST_TEST(v1 < v2); BOOST_TEST(v1 <= v2); BOOST_TEST(v2 > v1); BOOST_TEST(v2 >= v1); BOOST_TEST(v2 < v3); BOOST_TEST(v2 <= v3); BOOST_TEST(v3 > v2); BOOST_TEST(v3 >= v2); #if defined(FUSION_TEST_FAIL) FUSION_SEQUENCE v5(5, 'a', true); v1 >= v5; #endif BOOST_TEST(not_a_fusion_container() > v1); BOOST_TEST(not_a_fusion_container() >= v1); BOOST_TEST(not_a_fusion_container() < v1); BOOST_TEST(not_a_fusion_container() <= v1); }