From 4c067ee13d2aebcca5fbb66a33c67ad08e0b0938 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 25 Oct 2023 16:51:28 +0200 Subject: [PATCH] meta: suppress warnings due to implicit conversions - see #394 --- src/entt/meta/meta.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 9cd7303bc..06889cdd3 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -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(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(args), 1) + ... + 0u); }) != 0u); } /**