diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 39cfb8ad1..43afdd3b2 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -1497,12 +1497,8 @@ public: /*! @copydoc try_ctx */ template [[nodiscard]] Type *try_ctx() { - if constexpr(std::is_const_v) { - return std::as_const(*this).template try_ctx(); - } else { - auto it = vars.find(type_hash>>::value()); - return it == vars.end() ? nullptr : any_cast(&it->second); - } + auto it = vars.find(type_hash>>::value()); + return it == vars.end() ? nullptr : any_cast(&it->second); } /**