-
-
Save hkaiser/d81697a0c83212fbd4ea67a06d9d7508 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <hpx/type_support/always_void.hpp> | |
#include <utility> | |
namespace hpx { namespace traits { | |
/////////////////////////////////////////////////////////////////////////// | |
namespace detail { | |
template <typename T, typename U, typename Enable = void> | |
struct equality_result | |
{ | |
}; | |
template <typename T, typename U> | |
struct equality_result<T, U, | |
typename util::always_void<decltype( | |
std::declval<const T&>() == std::declval<const U&>())>::type> | |
{ | |
using type = | |
decltype(std::declval<const T&>() == std::declval<const U&>()); | |
}; | |
template <typename T, typename U, typename Enable = void> | |
struct inequality_result | |
{ | |
}; | |
template <typename T, typename U> | |
struct inequality_result<T, U, | |
typename util::always_void<decltype( | |
std::declval<const T&>() != std::declval<const U&>())>::type> | |
{ | |
using type = | |
decltype(std::declval<const T&>() != std::declval<const U&>()); | |
}; | |
} // namespace detail | |
template <typename Iter, typename Sent, typename Enable = void> | |
struct is_sentinel_for : std::false_type | |
{ | |
}; | |
template <typename Iter, typename Sent> | |
struct is_sentinel_for<Iter, Sent, | |
typename util::always_void< | |
typename detail::equality_result<Iter, Sent>::type, | |
typename detail::equality_result<Sent, Iter>::type, | |
typename detail::inequality_result<Iter, Sent>::type, | |
typename detail::inequality_result<Sent, Iter>::type | |
>::type> | |
: std::true_type | |
{ | |
}; | |
}} // namespace hpx::traits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment