CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
is_sentinel_for.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
12
13#include <type_traits>
14
15namespace CeresEngine::traits {
16
19 template<class S, class I, class = void> struct is_sentinel_for : std::false_type {};
20
21 template<class S, class I>
22 struct is_sentinel_for<S, I,
24 // clang-format off
25 std::is_same_v<S, I> ||
26 (is_semiregular_v<S> &&
27 is_input_or_output_iterator_v<I>)
28 // clang-format on
29 >> : std::true_type {};
30
32 template<class S, class I> bool constexpr is_sentinel_for_v = is_sentinel_for<S, I>::value;
33
35 template<class S, class I>
37
38} // namespace CeresEngine::traits
Definition is_sentinel_for.hpp:36
Definition Partitioner.hpp:146
bool constexpr is_sentinel_for_v
A C++17 type trait equivalent to the C++20 sentinel_for concept.
Definition is_sentinel_for.hpp:32
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Definition Span.hpp:668
A C++17 type trait equivalent to the C++20 sentinel_for concept.
Definition is_sentinel_for.hpp:19