FastLED
3.9.15
Loading...
Searching...
No Matches
◆
visit()
[2/2]
template<typename... Types>
template<typename Visitor>
void
fl::Variant
< Types >::visit
(
Visitor &
visitor
)
const
inline
Definition at line
153
of file
variant.h
.
153
{
154
if
(
_tag
==
Empty
)
155
return
;
156
157
// Fn is "a pointer to function taking (const void* storage, Visitor&)"
158
using
Fn
=
void
(*)(
const
void
*,
Visitor
&);
159
160
// Build a constexpr array of one thunk per type in Types...
161
static
constexpr
Fn
table
[] = {
162
&
Variant::template
visit_fn_const<Types, Visitor>
...};
163
164
// _tag is 1-based, so dispatch in O(1) via one indirect call:
165
table
[
_tag
- 1](&
_storage
,
visitor
);
166
}
fl::Variant::_storage
char _storage[max_size< Types... >::value]
Definition
variant.h:255
fl::Variant::visit_fn_const
static void visit_fn_const(const void *storage, Visitor &v)
Definition
variant.h:177
fl::Variant::Empty
static constexpr Tag Empty
Definition
variant.h:12
fl::Variant::_tag
Tag _tag
Definition
variant.h:257
fl::Variant
Definition
variant.h:9
fl
Variant
Generated on Sat May 24 2025 22:44:25 for FastLED by
1.13.2