27 using super = std::shared_ptr<T>;
85 if (super::use_count() == 0)
return nullptr;
88 std::unique_ptr<T> uptr{super::get()};
95template<
typename T,
typename... Args>
unsharable_shared_ptr< T > make_unsharable_shared(Args &&... args)
Signals that an object was in an invalid state when a method was invoked.
This class extends std::shared_ptr to allow for unsharing an exclusively held object and thereby conv...
void(*)(const void *) deleter_func_type
custom deleter type; use function pointer instead of reference due to clang-17 issue; use const void...
unsharable_shared_ptr(const unsharable_shared_ptr< Y > &ptr)
unsharable_shared_ptr & operator=(const std::shared_ptr< Y > &)=delete
friend unsharable_shared_ptr< To > as(unsharable_shared_ptr< From >)
static void noop_deleter(const void *)
unsharable_shared_ptr & operator=(unsharable_shared_ptr< Y > &&ptr)
static void default_deleter(const void *ptr)
std::unique_ptr< T > exclusive_shared_to_unique()
Converts (and thereby moves) the exclusively held object from this unsharable_shared_ptr to a std::un...
unsharable_shared_ptr & operator=(unsharable_shared_ptr &&)=default
unsharable_shared_ptr & operator=(const unsharable_shared_ptr< Y > &ptr)
friend unsharable_shared_ptr< To > cast(unsharable_shared_ptr< From >)
unsharable_shared_ptr(unsharable_shared_ptr &&)=default
unsharable_shared_ptr(Y *ptr)
unsharable_shared_ptr(const unsharable_shared_ptr &)=default
std::shared_ptr< T > super
unsharable_shared_ptr(const std::shared_ptr< Y > &)=delete
unsharable_shared_ptr & operator=(std::shared_ptr< Y > &&)=delete
unsharable_shared_ptr(unsharable_shared_ptr< Y > &&ptr)
unsharable_shared_ptr(std::shared_ptr< Y > &&ptr)
unsharable_shared_ptr & operator=(const unsharable_shared_ptr &)=default
unsharable_shared_ptr(std::nullptr_t)