From e6006663ecaadc70c93036afdc874c67038ff4e5 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Fri, 21 Jan 2022 11:08:07 +0100 Subject: [PATCH] registry: remove [[nodiscard]] from the template ::storage method --- src/entt/entity/registry.hpp | 4 ++-- test/entt/entity/registry.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/entt/entity/registry.hpp b/src/entt/entity/registry.hpp index 42beb3c1f..7a1202c9d 100644 --- a/src/entt/entity/registry.hpp +++ b/src/entt/entity/registry.hpp @@ -413,7 +413,7 @@ public: * @return The storage for the given component type. */ template - [[nodiscard]] decltype(auto) storage(const id_type id = type_hash::value()) { + decltype(auto) storage(const id_type id = type_hash::value()) { return assure(id); } @@ -429,7 +429,7 @@ public: * @return The storage for the given component type. */ template - [[nodiscard]] decltype(auto) storage(const id_type id = type_hash::value()) const { + decltype(auto) storage(const id_type id = type_hash::value()) const { return assure(id); } diff --git a/test/entt/entity/registry.cpp b/test/entt/entity/registry.cpp index 9b526f873..2012c1925 100644 --- a/test/entt/entity/registry.cpp +++ b/test/entt/entity/registry.cpp @@ -1873,8 +1873,8 @@ TEST(Registry, RuntimePools) { static_assert(std::is_same_vsecond), typename entt::storage_traits::storage_type::base_type &>); static_assert(std::is_same_vsecond), const typename entt::storage_traits::storage_type::base_type &>); - ASSERT_DEATH([[maybe_unused]] auto &&unused = registry.storage("other"_hs), ""); - ASSERT_DEATH([[maybe_unused]] auto &&unused = std::as_const(registry).storage("other"_hs), ""); + ASSERT_DEATH(auto &&unused = registry.storage("other"_hs), ""); + ASSERT_DEATH(auto &&unused = std::as_const(registry).storage("other"_hs), ""); ASSERT_NE(registry.storage("other"_hs), registry.storage().end()); ASSERT_EQ(std::as_const(registry).storage("rehto"_hs), registry.storage().end());