CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
is_decrementable.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
18 template<class I, class = void> struct is_decrementable : std::false_type {};
19
20 template<class I>
21 struct is_decrementable<I,
22 std::void_t<
23 // clang-format off
24 decltype(std::declval<I>()--)
25 // clang-format on
26 >>
27 : std::conjunction<
28 // clang-format off
29 is_regular<I>,
30 is_weakly_decrementable<I>,
31 std::is_same<decltype(std::declval<I>()--), I>
32 // clang-format on
33 > {};
34
36 template<class I> bool constexpr is_decrementable_v = is_decrementable<I>::value;
37
39 template<class I>
41
42} // namespace CeresEngine::traits
Definition is_decrementable.hpp:40
Definition Partitioner.hpp:146
bool constexpr is_decrementable_v
A C++17 type trait equivalent to the C++20 decrementable concept.
Definition is_decrementable.hpp:36
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 decrementable concept.
Definition is_decrementable.hpp:18