17 void *data_ =
nullptr;
25 BLI_assert(data_ ==
nullptr || type_ !=
nullptr);
30 template<
typename T, BLI_ENABLE_IF(!std::is_
void_v<T>)>
45 template<
typename T>
T *
get()
const
48 return static_cast<T *
>(data_);
53 return type_ !=
nullptr && type_->is<
T>();
60 type_->relocate_assign(data_, &value);
69 type_->destruct(data_);
79 const void *data_ =
nullptr;
89 BLI_assert(data_ ==
nullptr || type_ !=
nullptr);
96 const void *
get()
const
106 template<
typename T>
const T *
get()
const
109 return static_cast<const T *
>(data_);
114 return type_ !=
nullptr && type_->is<
T>();
GMutablePointer(const CPPType *type, void *data=nullptr)
GMutablePointer()=default
const CPPType * type() const
GMutablePointer(const CPPType &type, void *data=nullptr)
GPointer(GMutablePointer ptr)
const CPPType * type() const
GPointer(const CPPType &type, const void *data=nullptr)
GPointer(const CPPType *type, const void *data=nullptr)