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>();
79 const void *data_ =
nullptr;
86 GPointer(
const CPPType *type,
const void *data =
nullptr) : type_(type), data_(data)
89 BLI_assert(data_ ==
nullptr || type_ !=
nullptr);
92 GPointer(
const CPPType &type,
const void *data =
nullptr) : type_(&type), data_(data) {}
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>();
void destruct(void *ptr) const
void relocate_assign(void *src, void *dst) const
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)