Browse Source

view/group: make ::handle [[nodiscard]]

Michele Caini 3 years ago
parent
commit
ab33111192
2 changed files with 3 additions and 3 deletions
  1. 1 1
      src/entt/entity/group.hpp
  2. 2 2
      src/entt/entity/view.hpp

+ 1 - 1
src/entt/entity/group.hpp

@@ -163,7 +163,7 @@ public:
      * @brief Returns a const reference to the underlying handler.
      * @return A const reference to the underlying handler.
      */
-    const base_type &handle() const noexcept {
+    [[nodiscard]] const base_type &handle() const noexcept {
         return *handler;
     }
 

+ 2 - 2
src/entt/entity/view.hpp

@@ -309,7 +309,7 @@ public:
      * @brief Returns the leading storage of a view.
      * @return The leading storage of the view.
      */
-    const base_type &handle() const noexcept {
+    [[nodiscard]] const base_type &handle() const noexcept {
         return *view;
     }
 
@@ -587,7 +587,7 @@ public:
      * @brief Returns the leading storage of a view.
      * @return The leading storage of the view.
      */
-    const base_type &handle() const noexcept {
+    [[nodiscard]] const base_type &handle() const noexcept {
         return storage();
     }