Speeduino
Loading...
Searching...
No Matches
type_traits.h
Go to the documentation of this file.
1
6#pragma once
7
8namespace type_traits {
9
10 // std::remove_reference. See https://en.cppreference.com/w/cpp/types/remove_reference.html
11 template <typename T>
13 using type = T;
14 };
15 template <typename T>
17 using type = T;
18 };
19 template <typename T>
20 struct remove_reference<T&&> {
21 using type = T;
22 };
23
24}
25// std::numeric_limits. See https://en.cppreference.com/w/cpp/types/numeric_limits
26template <typename T>
28 static constexpr T (max)(void);
29};
30
31template <>
33 static constexpr uint8_t (max)(void) { return UINT8_MAX; }
34};
35
36template <>
38 static constexpr int8_t (max)(void) { return INT8_MAX; }
39};
40
41template <>
43 static constexpr uint16_t (max)(void) { return UINT16_MAX; }
44};
45
46template <>
48 static constexpr int16_t (max)(void) { return INT16_MAX; }
49};
50
51template <>
53 static constexpr uint32_t (max)(void) { return UINT32_MAX; }
54};
55
56template <>
58 static constexpr int32_t (max)(void) { return INT32_MAX; }
59};
static TIntegral readSerialIntegralTimeout(void)
Reads an integral type, timing out if necessary.
Definition comms.cpp:175
Definition type_traits.h:8
Definition type_traits.h:27
static constexpr T() max(void)
T type
Definition type_traits.h:17
T type
Definition type_traits.h:21
Definition type_traits.h:12
T type
Definition type_traits.h:13