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

◆ bit_cast()

template<typename To, typename From>
To fl::bit_cast ( const From & from)

Definition at line 48 of file bit_cast.h.

48 {
49 FL_STATIC_ASSERT(sizeof(To) == sizeof(From), "bit_cast: types must have the same size");
50 FL_STATIC_ASSERT(is_bitcast_compatible<To>::value, "bit_cast: destination type must be bitcast compatible");
51 FL_STATIC_ASSERT(is_bitcast_compatible<From>::value, "bit_cast: source type must be bitcast compatible");
52
53 To to;
54 fl::memcpy(&to, &from, sizeof(To));
55 return to;
56}
void * memcpy(void *dest, const void *src, size_t n) FL_NOEXCEPT
#define FL_STATIC_ASSERT(...)
static constexpr bool value
Definition bit_cast.h:26

References FL_NOEXCEPT, FL_STATIC_ASSERT, memcpy(), and fl::is_bitcast_compatible< T >::value.

Referenced by fl::SerializerVisitor::accept(), fl::SerializerVisitor::accept(), as_bytes(), as_writable_bytes(), bit_cast_ptr(), bit_cast_ptr(), fl::anonymous_namespace{json.cpp.hpp}::classify_array(), fl::Frame::convertPixelsToRgb(), fl::third_party::Mp3HelixDecoder::decodeFrame(), FL_ALIGNAS(), FL_DISABLE_WARNING(), fl::VectorN< T, INLINED_SIZE >::inline_memory(), int_to_ptr(), fl::isr::memset_zero_word(), fl::anonymous_namespace{json.cpp.hpp}::JsonBuilder::on_token(), fl::Hash< float >::operator()(), fl::unordered_map< Key, T, Hash, KeyEqual, INLINED_COUNT >::const_iterator::operator*(), fl::unordered_map< Key, T, Hash, KeyEqual, INLINED_COUNT >::iterator::operator*(), fl::anonymous_namespace{json.cpp.hpp}::JsonBuilder::parse_float_array(), ptr_to_int(), reinterpret_cast_(), reinterpret_pointer_cast(), and fl::UCS7604ControllerT< DATA_PIN, RGB_ORDER, fl::UCS7604Mode::UCS7604_MODE_8BIT_800KHZ, fl::TIMING_UCS7604_800KHZ, CLOCKLESS_CONTROLLER >::showPixels().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: