sparse_set: nodiscard get(s)

This commit is contained in:
Michele Caini
2022-04-15 16:02:53 +02:00
parent 485e29a672
commit e3113f6976

View File

@@ -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));
}