/*! @file Defines concepts from the Standard library. @copyright Louis Dionne 2013-2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_HANA_DETAIL_CONCEPTS_HPP #define BOOST_HANA_DETAIL_CONCEPTS_HPP #include #include #include #include namespace boost { namespace hana { namespace detail { //! @cond ////////////////////////////////////////////////////////////////////////// // EqualityComparable ////////////////////////////////////////////////////////////////////////// template struct EqualityComparable : std::false_type { }; template struct EqualityComparable(*(T*)0) == static_cast(*(T*)0) ? 0:0), decltype(static_cast(*(T*)0) != static_cast(*(T*)0) ? 0:0) >> : std::true_type { }; template struct EqualityComparable::value, detail::void_t< decltype(static_cast(*(T*)0) == static_cast(*(U*)0) ? 0:0), decltype(static_cast(*(U*)0) == static_cast(*(T*)0) ? 0:0), decltype(static_cast(*(T*)0) != static_cast(*(U*)0) ? 0:0), decltype(static_cast(*(U*)0) != static_cast(*(T*)0) ? 0:0), typename detail::std_common_type::type >>::type> : std::integral_constant::value && EqualityComparable::value && EqualityComparable::type>::value > { }; ////////////////////////////////////////////////////////////////////////// // LessThanComparable ////////////////////////////////////////////////////////////////////////// template struct LessThanComparable : std::false_type { }; template struct LessThanComparable(*(T*)0) < static_cast(*(T*)0) ? 0:0) >> : std::true_type { }; template struct LessThanComparable::value, detail::void_t< decltype(static_cast(*(T*)0) < static_cast(*(U*)0) ? 0:0), decltype(static_cast(*(U*)0) < static_cast(*(T*)0) ? 0:0), typename detail::std_common_type::type > >> : std::integral_constant::value && LessThanComparable::value && LessThanComparable::type>::value > { }; //! @endcond } }} // end namespace boost::hana #endif // !BOOST_HANA_DETAIL_CONCEPTS_HPP