Speeduino
Loading...
Searching...
No Matches
limits.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <stdint.h>
9
10// std::numeric_limits. See https://en.cppreference.com/w/cpp/types/numeric_limits
11template <typename T>
13 static constexpr T (max)(void);
14};
15
16template <>
18 static constexpr uint8_t (max)(void) { return UINT8_MAX; }
19};
20
21template <>
23 static constexpr int8_t (max)(void) { return INT8_MAX; }
24};
25
26template <>
28 static constexpr uint16_t (max)(void) { return UINT16_MAX; }
29};
30
31template <>
33 static constexpr int16_t (max)(void) { return INT16_MAX; }
34};
35
36template <>
38 static constexpr uint32_t (max)(void) { return UINT32_MAX; }
39};
40
41template <>
43 static constexpr int32_t (max)(void) { return INT32_MAX; }
44};
static TIntegral readSerialIntegralTimeout(void)
Reads an integral type, timing out if necessary.
Definition comms.cpp:175
Definition limits.h:12
static constexpr T() max(void)