CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
is_subtractable.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
16 template<class T, class = void> struct is_subtractable : std::false_type {};
17
18 template<class T>
19 struct is_subtractable<T,
20 std::void_t<
21 // clang-format off
22 decltype(std::declval<const std::remove_reference_t<T>&>() - std::declval<const std::remove_reference_t<T>&>())
23 // clang-format on
24 >> : std::is_integral<decltype(std::declval<const std::remove_reference_t<T>&>() - std::declval<const std::remove_reference_t<T>&>())> {};
25
27 template<class T> bool constexpr is_subtractable_v = is_subtractable<T>::value;
28
30 template<class T>
32
33} // namespace CeresEngine::traits
Definition is_subtractable.hpp:31
Definition Partitioner.hpp:146
bool constexpr is_subtractable_v
A C++17 type trait equivalent to the C++20 subtractable concept.
Definition is_subtractable.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 subtractable concept.
Definition is_subtractable.hpp:16