fiber
Loading...
Searching...
No Matches
type_traits.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include <cstdint>
5
6namespace fiber
7{
8// ---------------------------------------------------------------------------
9// make_fast
10// ---------------------------------------------------------------------------
11 template<std::integral UInt>
12 struct make_fast{};
13
14 template<std::unsigned_integral UInt>
15 requires (sizeof(UInt) == 1)
17 using type = uint_fast8_t;
18 };
19
20 template<std::unsigned_integral UInt>
21 requires (sizeof(UInt) == 2)
22 struct make_fast<UInt>{
23 using type = uint_fast16_t;
24 };
25
26 template<std::unsigned_integral UInt>
27 requires (sizeof(UInt) == 4)
28 struct make_fast<UInt>{
29 using type = uint_fast32_t;
30 };
31
32 template<std::unsigned_integral UInt>
33 requires (sizeof(UInt) == 8)
34 struct make_fast<UInt>{
35 using type = uint_fast64_t;
36 };
37
38
39
40
41 template<std::signed_integral SInt>
42 requires (sizeof(SInt) == 1)
44 using type = int_fast8_t;
45 };
46
47 template<std::signed_integral SInt>
48 requires (sizeof(SInt) == 2)
49 struct make_fast<SInt>{
50 using type = int_fast16_t;
51 };
52
53 template<std::signed_integral SInt>
54 requires (sizeof(SInt) == 4)
55 struct make_fast<SInt>{
56 using type = int_fast32_t;
57 };
58
59 template<std::signed_integral SInt>
60 requires (sizeof(SInt) == 8)
61 struct make_fast<SInt>{
62 using type = int_fast64_t;
63 };
64
65} // namespace fiber
Definition Duration.hpp:17
int_fast8_t type
Definition type_traits.hpp:44
uint_fast8_t type
Definition type_traits.hpp:17
Definition type_traits.hpp:12