81template<
typename T,
typename Deleter = default_delete<T>>
163 other.ptr_ =
nullptr;
164 other.control_block_ =
nullptr;
170 other.ptr_ =
nullptr;
171 other.control_block_ =
nullptr;
187 if (
this != &other) {
206 if (
this != &other) {
215 if (
static_cast<void*
>(
this) !=
static_cast<void*
>(&other)) {
289 explicit operator bool() const noexcept {
return ptr_ !=
nullptr; }
299 return ptr_ ==
nullptr;
303 return ptr_ !=
nullptr;
319 template<
typename Y,
typename Deleter>
331 template<
typename Y,
typename... Args>
334 template<
typename Y,
typename Deleter,
typename... Args>
337 template<
typename Y,
typename A,
typename... Args>
347template<
typename T,
typename... Args>
358template<
typename T,
typename Deleter,
typename... Args>
385template<
typename T,
typename A,
typename... Args>
393template<
typename T,
typename Y>
395 return lhs.get() == rhs.get();
398template<
typename T,
typename Y>
400 return lhs.get() != rhs.get();
403template<
typename T,
typename Y>
405 return lhs.get() < rhs.get();
408template<
typename T,
typename Y>
410 return lhs.get() <= rhs.get();
413template<
typename T,
typename Y>
415 return lhs.get() > rhs.get();
418template<
typename T,
typename Y>
420 return lhs.get() >= rhs.get();
425 return lhs.get() ==
nullptr;
430 return nullptr == rhs.get();
435 return lhs.get() !=
nullptr;
440 return nullptr != rhs.get();
450template<
typename T,
typename Y>
452 auto ptr =
static_cast<T*
>(other.get());
457template<
typename T,
typename Y>
459 auto ptr =
const_cast<T*
>(other.get());
463template<
typename T,
typename Y>
Result type for promise operations.
T & operator*() const noexcept
long use_count() const noexcept
shared_ptr(T *ptr, detail::ControlBlockBase *control_block, detail::make_shared_tag)
shared_ptr(T *ptr, detail::ControlBlockBase *control_block, detail::no_tracking_tag)
T & operator[](ptrdiff_t idx) const
bool operator==(fl::nullptr_t) const noexcept
friend shared_ptr< Y > allocate_shared(const A &alloc, Args &&... args)
friend shared_ptr< Y > make_shared_with_deleter(Deleter d, Args &&... args)
shared_ptr & operator=(shared_ptr< Y > &&other) noexcept
friend shared_ptr< Y > make_shared(Args &&... args)
friend shared_ptr< Y > make_shared_no_tracking(Y &obj)
bool operator!=(fl::nullptr_t) const noexcept
void swap(shared_ptr &&other) noexcept
detail::ControlBlockBase * control_block_
void reset(shared_ptr &&other) noexcept
shared_ptr(Y *ptr, Deleter d)
shared_ptr(shared_ptr< Y > &&other) noexcept
shared_ptr & operator=(shared_ptr &&other) noexcept
shared_ptr(shared_ptr &&other) noexcept
T * operator->() const noexcept
bool unique() const noexcept
shared_ptr(const shared_ptr &other)
shared_ptr(fl::nullptr_t) noexcept
shared_ptr & operator=(const shared_ptr< Y > &other)
shared_ptr(const shared_ptr< Y > &other)
bool is_no_tracking() const noexcept
shared_ptr & operator=(const shared_ptr &other)
void swap(shared_ptr &other) noexcept
Implements the FastLED namespace macros.
shared_ptr< T > const_pointer_cast(const shared_ptr< Y > &other) noexcept
void swap(array< T, N > &lhs, array< T, N > &rhs) noexcept(noexcept(lhs.swap(rhs)))
To bit_cast(const From &from) noexcept
shared_ptr< T > make_shared_no_tracking(T &obj)
bool operator!=(const array< T, N > &lhs, const array< T, N > &rhs)
__PTRDIFF_TYPE__ ptrdiff_t
shared_ptr< T > static_pointer_cast(const shared_ptr< Y > &other) noexcept
bool operator>=(const pair< T1, T2 > &lhs, const pair< U1, U2 > &rhs)
atomic< fl::u32 > atomic_u32
decltype(nullptr) nullptr_t
shared_ptr< T > reinterpret_pointer_cast(const shared_ptr< Y > &other) noexcept
shared_ptr< T > make_shared(Args &&... args)
shared_ptr< T > allocate_shared(const A &, Args &&... args)
bool operator<(const pair< T1, T2 > &lhs, const pair< U1, U2 > &rhs)
bool operator==(const array< T, N > &lhs, const array< T, N > &rhs)
bool operator<=(const pair< T1, T2 > &lhs, const pair< U1, U2 > &rhs)
constexpr T && forward(typename remove_reference< T >::type &t) noexcept
bool operator>(const pair< T1, T2 > &lhs, const pair< U1, U2 > &rhs)
shared_ptr< T > make_shared_with_deleter(Deleter d, Args &&... args)
void destroy_object() override
void destroy_control_block() override
ControlBlock(T *p, Deleter d=Deleter(), bool track=true)
ControlBlockBase(bool track=true)
static constexpr fl::u32 NO_TRACKING_VALUE
virtual ~ControlBlockBase()=default
fl::atomic_u32 shared_count
virtual void destroy_object()=0
bool is_no_tracking() const
fl::atomic_u32 weak_count
virtual void destroy_control_block()=0
void operator()(T *) const
void operator()(T *ptr) const
void operator()(T *) const