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

◆ vector_element_ops_for()

template<typename T>
const vector_element_ops * fl::vector_element_ops_for ( )

Generate a static ops table for type T.

Returns nullptr for trivially copyable types (fast path).

Definition at line 312 of file basic_vector.h.

312 {
313 // Trivially copyable types use the fast path (mOps == nullptr)
315 return nullptr;
316 }
317
318 static const vector_element_ops ops = {
319 detail::get_copy_construct_fn<T>(), // copy_construct
320 detail::get_move_construct_fn<T>(), // move_construct
321 [](void* ptr) { static_cast<T*>(ptr)->~T(); }, // destroy
322 detail::get_default_construct_fn<T>(), // default_construct
323 detail::get_swap_fn<T>(), // swap_elements
324 detail::get_uninitialized_move_n_fn<T>(), // uninitialized_move_n
325 // destroy_n
326 [](void* first, fl::size count) FL_NOEXCEPT {
327 T* p = static_cast<T*>(first);
328 for (fl::size i = 0; i < count; ++i) {
329 p[i].~T();
330 }
331 }
332 };
333 return &ops;
334}
fl::enable_if< is_swappable< T >::value, void(*)(void *, void *) FL_NOEXCEPT >::type get_swap_fn() FL_NOEXCEPT
fl::enable_if< has_move_ctor< T >::value, void(*)(void *, void *) FL_NOEXCEPT >::type get_move_construct_fn() FL_NOEXCEPT
fl::enable_if< has_copy_ctor< T >::value, void(*)(void *, constvoid *) FL_NOEXCEPT >::type get_copy_construct_fn() FL_NOEXCEPT
fl::enable_if< has_default_ctor< T >::value, void(*)(void *) FL_NOEXCEPT >::type get_default_construct_fn() FL_NOEXCEPT
fl::enable_if< has_move_ctor< T >::value, void(*)(void *, void *, fl::size) FL_NOEXCEPT >::type get_uninitialized_move_n_fn() FL_NOEXCEPT
#define FL_NOEXCEPT

References FL_NOEXCEPT, fl::detail::get_copy_construct_fn(), fl::detail::get_default_construct_fn(), fl::detail::get_move_construct_fn(), fl::detail::get_swap_fn(), fl::detail::get_uninitialized_move_n_fn(), and fl::fl::is_trivially_copyable< T >::value.

Referenced by fl::vector< fl::i16 >::vector(), fl::vector< fl::i16 >::vector(), fl::vector< fl::i16 >::vector(), fl::vector< fl::i16 >::vector(), fl::vector< fl::i16 >::vector(), fl::vector< fl::i16 >::vector(), fl::vector< fl::i16 >::vector(), fl::vector< fl::i16 >::vector(), fl::vector< fl::i16 >::vector(), fl::vector< fl::i16 >::vector(), fl::vector< fl::i16 >::vector(), and fl::vector< fl::i16 >::vector().

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