Browse Source

*: minor changes

Michele Caini 4 years ago
parent
commit
044d14f542
2 changed files with 5 additions and 5 deletions
  1. 1 1
      src/entt/meta/meta.hpp
  2. 4 4
      test/entt/meta/meta_base.cpp

+ 1 - 1
src/entt/meta/meta.hpp

@@ -966,7 +966,7 @@ private:
 /*! @brief Opaque wrapper for types. */
 class meta_type {
     template<auto Member, typename Pred>
-    const auto *lookup(meta_any *const args, const typename internal::meta_type_node::size_type sz, Pred pred) const {
+    [[nodiscard]] const auto *lookup(meta_any *const args, const typename internal::meta_type_node::size_type sz, Pred pred) const {
         std::decay_t<decltype(node->*Member)> candidate{};
         size_type extent{sz + 1u};
         bool ambiguous{};

+ 4 - 4
test/entt/meta/meta_base.cpp

@@ -91,10 +91,10 @@ TEST_F(MetaBase, SetGetWithMutatingThis) {
     ASSERT_TRUE(any.set("value_2"_hs, 2));
     ASSERT_TRUE(any.set("value_3"_hs, 3));
 
-    ASSERT_FALSE(any.type().set("value"_hs, as_cref, 0));
-    ASSERT_FALSE(any.type().set("value_1"_hs, as_cref, 0));
-    ASSERT_FALSE(any.type().set("value_2"_hs, as_cref, 0));
-    ASSERT_FALSE(any.type().set("value_3"_hs, as_cref, 0));
+    ASSERT_FALSE(as_cref.set("value"_hs, 0));
+    ASSERT_FALSE(as_cref.set("value_1"_hs, 0));
+    ASSERT_FALSE(as_cref.set("value_2"_hs, 0));
+    ASSERT_FALSE(as_cref.set("value_3"_hs, 0));
 
     ASSERT_EQ(any.get("value"_hs).cast<int>(), 42);
     ASSERT_EQ(any.get("value_1"_hs).cast<const int>(), 1);