meta: suppress warnings due to implicit conversions - see #394

This commit is contained in:
Michele Caini
2023-10-25 16:51:28 +02:00
parent 5cb7fc2610
commit 4c067ee13d
+2 -2
View File
@@ -1319,7 +1319,7 @@ public:
*/
[[nodiscard]] bool can_cast(const meta_type &other) const noexcept {
// casting this is UB in all cases but we aren't going to use the resulting pointer, so...
return internal::try_cast(internal::meta_context::from(*ctx), node, other.node, this);
return (internal::try_cast(internal::meta_context::from(*ctx), node, other.node, this) != nullptr);
}
/**
@@ -1328,7 +1328,7 @@ public:
* @return True if the conversion is allowed, false otherwise.
*/
[[nodiscard]] bool can_convert(const meta_type &other) const noexcept {
return internal::try_convert(internal::meta_context::from(*ctx), node, other.info(), other.is_arithmetic() || other.is_enum(), nullptr, [](const void *, auto &&...args) { return ((static_cast<void>(args), 1) + ... + 0u); });
return (internal::try_convert(internal::meta_context::from(*ctx), node, other.info(), other.is_arithmetic() || other.is_enum(), nullptr, [](const void *, auto &&...args) { return ((static_cast<void>(args), 1) + ... + 0u); }) != 0u);
}
/**