diff --git a/source/blender/blenlib/BLI_cpp_type.hh b/source/blender/blenlib/BLI_cpp_type.hh index 085a6505c0e..84e755ef341 100644 --- a/source/blender/blenlib/BLI_cpp_type.hh +++ b/source/blender/blenlib/BLI_cpp_type.hh @@ -447,6 +447,9 @@ void register_cpp_types(); namespace blender { +/* Give a compile error instead of a link error when type information is missing. */ +template<> const CPPType &CPPType::get_impl() = delete; + /** * Two types only compare equal when their pointer is equal. No two instances of CPPType for the * same C++ type should be created. diff --git a/source/blender/blenlib/BLI_generic_pointer.hh b/source/blender/blenlib/BLI_generic_pointer.hh index d0882c55bed..013e6b25200 100644 --- a/source/blender/blenlib/BLI_generic_pointer.hh +++ b/source/blender/blenlib/BLI_generic_pointer.hh @@ -100,7 +100,10 @@ class GPointer { GPointer(const CPPType &type, const void *data = nullptr) : type_(&type), data_(data) {} - template GPointer(T *data) : GPointer(&CPPType::get(), data) {} + template))> + GPointer(T *data) : GPointer(&CPPType::get(), data) + { + } operator bool() const {