[Bf-blender-cvs] [89ebdfdb83b] temp-cpp-type-cleanup: cleanup
Jacques Lucke
noreply at git.blender.org
Sun Jun 27 17:07:05 CEST 2021
Commit: 89ebdfdb83b78136307682edcb74508e7e1dd6b0
Author: Jacques Lucke
Date: Sun Jun 27 16:39:49 2021 +0200
Branches: temp-cpp-type-cleanup
https://developer.blender.org/rB89ebdfdb83b78136307682edcb74508e7e1dd6b0
cleanup
===================================================================
M source/blender/functions/FN_cpp_type.hh
M source/blender/functions/FN_multi_function_builder.hh
===================================================================
diff --git a/source/blender/functions/FN_cpp_type.hh b/source/blender/functions/FN_cpp_type.hh
index e4c21885b40..0b7e378dcc2 100644
--- a/source/blender/functions/FN_cpp_type.hh
+++ b/source/blender/functions/FN_cpp_type.hh
@@ -548,7 +548,7 @@ class CPPType : NonCopyable, NonMovable {
void print_or_default(const void *value, std::stringstream &ss, StringRef default_value) const
{
if (this->is_printable()) {
- m_.print(value, ss);
+ this->print(value, ss);
}
else {
ss << default_value;
@@ -562,6 +562,14 @@ class CPPType : NonCopyable, NonMovable {
return m_.is_equal(a, b);
}
+ bool is_equal_or_false(const void *a, const void *b) const
+ {
+ if (this->is_equality_comparable()) {
+ return this->is_equal(a, b);
+ }
+ return false;
+ }
+
uint64_t hash(const void *value) const
{
BLI_assert(this->pointer_can_point_to_instance(value));
diff --git a/source/blender/functions/FN_multi_function_builder.hh b/source/blender/functions/FN_multi_function_builder.hh
index 691abeb18c0..7a526bb640b 100644
--- a/source/blender/functions/FN_multi_function_builder.hh
+++ b/source/blender/functions/FN_multi_function_builder.hh
@@ -398,7 +398,7 @@ template<typename T> class CustomMF_Constant : public MultiFunction {
if (other2 != nullptr) {
const CPPType &type = CPPType::get<T>();
if (type == other2->type_) {
- return type.is_equal(static_cast<const void *>(&value_), other2->value_);
+ return type.is_equal_or_false(static_cast<const void *>(&value_), other2->value_);
}
}
return false;
More information about the Bf-blender-cvs
mailing list