-
-
Save hkaiser/05a9215d0ac2a07a1d74840553ee93be 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::inequality_result<Iter, Sent>::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