Browse Source

sparse_set: nodiscard get(s)

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

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

@@ -636,12 +636,12 @@ public:
      * @param entt A valid identifier.
      * @param entt A valid identifier.
      * @return An opaque pointer to the element assigned to the entity, if any.
      * @return An opaque pointer to the element assigned to the entity, if any.
      */
      */
-    const void *get(const entity_type entt) const ENTT_NOEXCEPT {
+    [[nodiscard]] const void *get(const entity_type entt) const ENTT_NOEXCEPT {
         return get_at(index(entt));
         return get_at(index(entt));
     }
     }
 
 
     /*! @copydoc get */
     /*! @copydoc get */
-    void *get(const entity_type entt) ENTT_NOEXCEPT {
+    [[nodiscard]] void *get(const entity_type entt) ENTT_NOEXCEPT {
         return const_cast<void *>(std::as_const(*this).get(entt));
         return const_cast<void *>(std::as_const(*this).get(entt));
     }
     }