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

◆ get() [1/2]

template<typename... Types>
template<typename T>
T & fl::Variant< Types >::get ( )
inline

Get a reference to the stored value of type T.

Template Parameters
TThe type to retrieve
Returns
Reference to the stored value
Note
Asserts if the variant doesn't contain type T. Use is<T>() to check first.
Warning
Will crash if called with wrong type - this is intentional for fast failure

Definition at line 129 of file variant.h.

129 {
130 // Dereference ptr() directly - will crash with null pointer access if wrong type
131 // This provides fast failure semantics similar to std::variant
132 return *ptr<T>();
133 }
T * ptr()
Definition variant.h:110