uatlib
type.hpp
Go to the documentation of this file.
1 
4 #ifndef UAT_TYPE_HPP
5 #define UAT_TYPE_HPP
6 
7 #include <concepts>
8 #include <cstddef>
9 #include <cstdint>
10 #include <functional>
11 
12 namespace uat
13 {
14 
16 template <typename T>
17 concept hashable = requires(T a)
18 {
19  {
20  std::hash<T>{}(a)
21  } -> std::convertible_to<std::size_t>;
22 };
23 
25 template <typename R>
26 concept region_compatible = hashable<R> && std::equality_comparable<R> && std::copyable<R>;
27 
29 using uint_t = std::size_t;
30 
32 using id_t = std::size_t;
33 
35 using value_t = double;
36 
37 } // namespace uat
38 
39 #endif // UAT_TYPE_HPP
std::size_t uint_t
Default unsigned integer type.
Definition: type.hpp:29
concept hashable
Concept for types that are hashable.
Definition: type.hpp:17
concept region_compatible
Concept for types that are compatible as regions.
Definition: type.hpp:26
std::size_t id_t
Default type for identifier.
Definition: type.hpp:32
double value_t
Default type for price.
Definition: type.hpp:35