File indexing completed on 2025-01-18 09:38:12
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_HISTOGRAM_DETAIL_RELAXED_EQUAL_HPP
0008 #define BOOST_HISTOGRAM_DETAIL_RELAXED_EQUAL_HPP
0009
0010 #include <boost/histogram/detail/priority.hpp>
0011 #include <type_traits>
0012
0013 namespace boost {
0014 namespace histogram {
0015 namespace detail {
0016
0017 struct relaxed_equal {
0018 template <class T, class U>
0019 constexpr auto impl(const T& t, const U& u, priority<1>) const noexcept
0020 -> decltype(t == u) const {
0021 return t == u;
0022 }
0023
0024
0025 template <class T, class U>
0026 constexpr bool impl(const T&, const U&, priority<0>) const noexcept {
0027 return false;
0028 }
0029
0030
0031 template <class T>
0032 constexpr bool impl(const T&, const T&, priority<0>) const noexcept {
0033 return std::is_empty<T>::value;
0034 }
0035
0036 template <class T, class U>
0037 constexpr bool operator()(const T& t, const U& u) const noexcept {
0038 return impl(t, u, priority<1>{});
0039 }
0040 };
0041
0042 }
0043 }
0044 }
0045
0046 #endif