Pārlūkot izejas kodu

sparse_set: nodiscard get(s)

Michele Caini 3 gadi atpakaļ
vecāks
revīzija
e3113f6976
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  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.
      * @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));
     }
 
     /*! @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));
     }