FastLED 3.9.15
Loading...
Searching...
No Matches

◆ visit() [1/2]

template<typename... Types>
template<typename Visitor>
void fl::Variant< Types >::visit ( Visitor & visitor)
inline

Definition at line 136 of file variant.h.

136 {
137 if (_tag == Empty)
138 return;
139
140 // Fn is "a pointer to function taking (void* storage, Visitor&)"
141 using Fn = void (*)(void *, Visitor &);
142
143 // Build a constexpr array of one thunk per type in Types...
144 // Each thunk casts the storage back to the right T* and calls
145 // visitor.accept
146 static constexpr Fn table[] = {
148
149 // _tag is 1-based, so dispatch in O(1) via one indirect call:
150 table[_tag - 1](&_storage, visitor);
151 }
char _storage[max_size< Types... >::value]
Definition variant.h:255
static void visit_fn(void *storage, Visitor &v)
Definition variant.h:171
static constexpr Tag Empty
Definition variant.h:12

Referenced by fl::Gradient::Gradient().

+ Here is the caller graph for this function: