detail_relaxed_equal_test.cpp 645 B

123456789101112131415161718192021222324252627
  1. // Copyright 2015-2017 Hans Dembinski
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt
  5. // or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. #include <boost/core/lightweight_test.hpp>
  7. #include <boost/core/lightweight_test_trait.hpp>
  8. #include <boost/histogram/detail/relaxed_equal.hpp>
  9. #include "std_ostream.hpp"
  10. using namespace boost::histogram::detail;
  11. int main() {
  12. struct A {};
  13. A a, b;
  14. struct B {
  15. bool operator==(const B&) const { return false; }
  16. };
  17. B c, d;
  18. BOOST_TEST(relaxed_equal(a, b));
  19. BOOST_TEST_NOT(relaxed_equal(c, d));
  20. return boost::report_errors();
  21. }