26 const T *data_ =
nullptr;
40 this->add_user(data_);
45 other.data_ =
nullptr;
50 this->remove_user_and_delete_if_last(data_);
59 this->remove_user_and_delete_if_last(data_);
61 this->add_user(data_);
71 this->remove_user_and_delete_if_last(data_);
73 other.data_ =
nullptr;
91 return data_ !=
nullptr;
101 const T *
data = data_;
108 this->remove_user_and_delete_if_last(data_);
114 return data_ !=
nullptr;
140 static void add_user(
const T *
data)
142 if (
data !=
nullptr) {
143 if constexpr (IsStrong) {
147 data->add_weak_user();
152 static void remove_user_and_delete_if_last(
const T *
data)
154 if (
data !=
nullptr) {
155 if constexpr (IsStrong) {
156 data->remove_user_and_delete_if_last();
159 data->remove_weak_user_and_delete_if_last();
195 if (
this == &other) {
198 std::destroy_at(
this);
205 if (
this == &other) {
208 std::destroy_at(
this);
215 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)
GeometryComponent element_type
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)
static constexpr bool is_ImplicitSharingPtr_strong_v