FastLED 3.9.15
Loading...
Searching...
No Matches
static_constexpr_defs.cpp.hpp
Go to the documentation of this file.
1// ok no header
2// Static constexpr member definitions for C++11 compatibility
3// In C++11, static constexpr members that are ODR-used need out-of-class definitions
4// in a single translation unit to avoid duplicate symbol errors.
5//
6// NOTE: After converting most traits to use enum instead of static constexpr,
7// only a few members still need definitions here (those that use template expressions
8// or other complex initializers that can't be put in enums).
9
10#include "fl/stl/type_traits.h"
11#include "fl/stl/limits.h"
12// IWYU pragma: begin_keep
13#include "platforms/shared/spi_bitbang/spi_block_8.h" // ok platform headers
14#include "platforms/shared/spi_bitbang/spi_block_16.h" // ok platform headers
15
16// IWYU pragma: end_keep
17namespace fl {
18
19// numeric_limits - Only define static constexpr members that use template expressions
20// (enum members don't need definitions)
21
22// char - is_signed uses expression, digits/digits10 use template expressions
26
27// signed char
30
31// unsigned char
34
35// short
38
39// unsigned short
42
43// int
46
47// unsigned int
50
51// long
54
55// unsigned long
58
59// long long
62
63// unsigned long long
66
67// float - static constexpr members
73
74// double - static constexpr members
80
81// type_rank - static constexpr members
82template <typename T> constexpr int type_rank<T>::value;
98
99// SpiBlock8
100constexpr int SpiBlock8::NUM_DATA_PINS;
101constexpr u16 SpiBlock8::MAX_BUFFER_SIZE;
102
103// SpiBlock16
104constexpr int SpiBlock16::NUM_DATA_PINS;
105constexpr u16 SpiBlock16::MAX_BUFFER_SIZE;
106
107} // namespace fl
Base definition for an LED controller.
Definition crgb.hpp:179
static constexpr int value