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

◆ ptr() [1/2]

template<typename... Types>
template<typename T>
T * fl::Variant< Types >::ptr ( )
inline

Definition at line 110 of file variant.h.

110 {
111 if (!is<T>()) return nullptr;
112 // Use bit_cast_ptr for safe type-punning on properly aligned storage
113 // The storage is guaranteed to be properly aligned by alignas(max_align<Types...>::value)
114 return fl::bit_cast_ptr<T>(&_storage[0]);
115 }
char _storage[max_size< Types... >::value]
Definition variant.h:294
bool is() const noexcept
Definition variant.h:106
To * bit_cast_ptr(void *storage) noexcept
Definition bit_cast.h:54

Referenced by fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::emplace(), fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::get(), and fl::Variant< fl::span< CRGB >, fl::vector< CRGB, fl::allocator_psram< CRGB > > >::get().

+ Here is the caller graph for this function: