|
|
@@ -46,27 +46,27 @@ public:
|
|
|
*
|
|
|
* @return A reference to the managed resource.
|
|
|
*/
|
|
|
- const Resource & get() const ENTT_NOEXCEPT {
|
|
|
+ [[nodiscard]] const Resource & get() const ENTT_NOEXCEPT {
|
|
|
ENTT_ASSERT(static_cast<bool>(resource));
|
|
|
return *resource;
|
|
|
}
|
|
|
|
|
|
/*! @copydoc get */
|
|
|
- Resource & get() ENTT_NOEXCEPT {
|
|
|
+ [[nodiscard]] Resource & get() ENTT_NOEXCEPT {
|
|
|
return const_cast<Resource &>(std::as_const(*this).get());
|
|
|
}
|
|
|
|
|
|
/*! @copydoc get */
|
|
|
- operator const Resource & () const ENTT_NOEXCEPT { return get(); }
|
|
|
+ [[nodiscard]] operator const Resource & () const ENTT_NOEXCEPT { return get(); }
|
|
|
|
|
|
/*! @copydoc get */
|
|
|
- operator Resource & () ENTT_NOEXCEPT { return get(); }
|
|
|
+ [[nodiscard]] operator Resource & () ENTT_NOEXCEPT { return get(); }
|
|
|
|
|
|
/*! @copydoc get */
|
|
|
- const Resource & operator *() const ENTT_NOEXCEPT { return get(); }
|
|
|
+ [[nodiscard]] const Resource & operator *() const ENTT_NOEXCEPT { return get(); }
|
|
|
|
|
|
/*! @copydoc get */
|
|
|
- Resource & operator *() ENTT_NOEXCEPT { return get(); }
|
|
|
+ [[nodiscard]] Resource & operator *() ENTT_NOEXCEPT { return get(); }
|
|
|
|
|
|
/**
|
|
|
* @brief Gets a pointer to the managed resource.
|
|
|
@@ -79,13 +79,13 @@ public:
|
|
|
* @return A pointer to the managed resource or `nullptr` if the handle
|
|
|
* contains no resource at all.
|
|
|
*/
|
|
|
- const Resource * operator->() const ENTT_NOEXCEPT {
|
|
|
+ [[nodiscard]] const Resource * operator->() const ENTT_NOEXCEPT {
|
|
|
ENTT_ASSERT(static_cast<bool>(resource));
|
|
|
return resource.get();
|
|
|
}
|
|
|
|
|
|
/*! @copydoc operator-> */
|
|
|
- Resource * operator->() ENTT_NOEXCEPT {
|
|
|
+ [[nodiscard]] Resource * operator->() ENTT_NOEXCEPT {
|
|
|
return const_cast<Resource *>(std::as_const(*this).operator->());
|
|
|
}
|
|
|
|
|
|
@@ -93,7 +93,7 @@ public:
|
|
|
* @brief Returns true if a handle contains a resource, false otherwise.
|
|
|
* @return True if the handle contains a resource, false otherwise.
|
|
|
*/
|
|
|
- explicit operator bool() const ENTT_NOEXCEPT {
|
|
|
+ [[nodiscard]] explicit operator bool() const ENTT_NOEXCEPT {
|
|
|
return static_cast<bool>(resource);
|
|
|
}
|
|
|
|