dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
concepts.h
1
10#pragma once
11
12#include <concepts>
13
14namespace dlinear {
15
25template <typename T, typename... U>
26concept IsAnyOf = (std::same_as<T, U> || ...);
27
37template <typename T, typename... U>
38concept IsNotAnyOf = !IsAnyOf<T, U...>;
39
48template <class T>
49concept Arithmetic = requires(T a, T b) {
50 { a + b } -> std::convertible_to<T>;
51 { a - b } -> std::convertible_to<T>;
52 { a* b } -> std::convertible_to<T>;
53 { a / b } -> std::convertible_to<T>;
54}; // NOLINT(readability/braces) per C++ standard concept definition
55
64template <class T>
65concept Numeric = std::totally_ordered<T> && Arithmetic<T>;
66
67} // namespace dlinear
Check if the type T supports the arithmetic operations +, -, *, /.
Definition concepts.h:49
Check if the type T is any of the types U.
Definition concepts.h:26
Check if the type T is not any of the types U.
Definition concepts.h:38
Check if the type T supports the arithmetic operations +, -, *, / and the comparison operators <,...
Definition concepts.h:65
Global namespace for the dlinear library.
@ U
Upper bound.