26 const T *data_ =
nullptr;
38 this->add_user(data_);
43 other.data_ =
nullptr;
48 this->remove_user_and_delete_if_last(data_);
57 this->remove_user_and_delete_if_last(data_);
59 this->add_user(data_);
69 this->remove_user_and_delete_if_last(data_);
71 other.data_ =
nullptr;
89 return data_ !=
nullptr;
99 const T *
data = data_;
106 this->remove_user_and_delete_if_last(data_);
112 return data_ !=
nullptr;
138 static void add_user(
const T *
data)
140 if (
data !=
nullptr) {
141 if constexpr (IsStrong) {
145 data->add_weak_user();
150 static void remove_user_and_delete_if_last(
const T *
data)
152 if (
data !=
nullptr) {
153 if constexpr (IsStrong) {
154 data->remove_user_and_delete_if_last();
157 data->remove_weak_user_and_delete_if_last();
193 if (
this == &other) {
196 std::destroy_at(
this);
203 if (
this == &other) {
206 std::destroy_at(
this);
213 this->data =
nullptr;
#define BLI_STRUCT_EQUALITY_OPERATORS_1(Type, m)
BMesh const char void * data
unsigned long long int uint64_t
ImplicitSharingPtrAndData & operator=(const ImplicitSharingPtrAndData &other)
ImplicitSharingPtrAndData & operator=(ImplicitSharingPtrAndData &&other)
ImplicitSharingPtrAndData()=default
~ImplicitSharingPtrAndData()
ImplicitSharingPtrAndData(ImplicitSharingPtr<> sharing_info, const void *data)
ImplicitSharingPtr sharing_info
ImplicitSharingPtrAndData(const ImplicitSharingPtrAndData &other)=default
ImplicitSharingPtrAndData(ImplicitSharingPtrAndData &&other)
friend bool operator==(const ImplicitSharingPtr &a, const T *b)
ImplicitSharingPtr & operator=(ImplicitSharingPtr &&other)
ImplicitSharingPtr(const T *data)
ImplicitSharingPtr(ImplicitSharingPtr &&other)
static uint64_t hash_as(const T *data)
ImplicitSharingPtr()=default
ImplicitSharingPtr & operator=(const ImplicitSharingPtr &other)
const T * operator->() const
ImplicitSharingPtr(std::nullptr_t)
ImplicitSharingPtr(const ImplicitSharingPtr &other)
const T & operator*() const
ImplicitSharingPtr< ImplicitSharingInfo, false > WeakImplicitSharingPtr
uint64_t get_default_hash(const T &v, const Args &...args)