21 void *data_ =
nullptr;
29 BLI_assert(data_ ==
nullptr || type_ !=
nullptr);
34 template<
typename T, BLI_ENABLE_IF(!std::is_
void_v<T>)>
51 return data_ !=
nullptr;
54 template<
typename T> T *
get()
const
57 return static_cast<T *
>(data_);
62 return type_ !=
nullptr && type_->
is<T>();
88 const void *data_ =
nullptr;
98 BLI_assert(data_ ==
nullptr || type_ !=
nullptr);
105 operator bool()
const
107 return data_ !=
nullptr;
120 template<
typename T>
const T *
get()
const
123 return static_cast<const T *
>(data_);
128 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)