Skip to content

Instantly share code, notes, and snippets.

@gonidelis
Last active June 14, 2020 15:27
Show Gist options
  • Save gonidelis/34c4e0ce645d4e5564da3076da74ed3f to your computer and use it in GitHub Desktop.
Save gonidelis/34c4e0ce645d4e5564da3076da74ed3f to your computer and use it in GitHub Desktop.
#pragma once
#include <hpx/type_support/always_void.hpp>
#include <hpx/iterator_support/traits/is_iterator.hpp>
#include <utility>
namespace hpx { namespace traits {
template <typename Sent, typename Iter, typename Enable = void>
struct is_sentinel_for : std::false_type
{
};
template <typename Sent, typename Iter>
struct is_sentinel_for<Sent, Iter,
typename util::always_void<
typename std::enable_if<is_iterator<Iter>::value>::type,
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