CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
is_range.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
10#include <type_traits>
11
12namespace CeresEngine::traits {
13
15 template<class T, class = void> struct is_range : std::false_type {};
16
17 template<class T>
18 struct is_range<T,
19 std::void_t<
20 // clang-format off
21 decltype(*std::begin(std::declval<T>())),
22 decltype(*std::end(std::declval<T>()))
23 // clang-format on
24 >> : std::true_type {};
25
27 template<class T> bool constexpr is_range_v = is_range<T>::value;
28
30 template<class T>
32
33} // namespace CeresEngine::traits
Definition is_range.hpp:31
Definition Partitioner.hpp:146
bool constexpr is_range_v
A C++17 type trait equivalent to the C++20 range concept.
Definition is_range.hpp:27
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 range concept.
Definition is_range.hpp:15