diff --git a/src/entt/locator/locator.hpp b/src/entt/locator/locator.hpp index 47f0c8adf..7387aa057 100644 --- a/src/entt/locator/locator.hpp +++ b/src/entt/locator/locator.hpp @@ -24,7 +24,7 @@ namespace entt { * @tparam Service Service type. */ template -struct locator { +struct locator final { /*! @brief Service type. */ using type = Service; @@ -67,7 +67,7 @@ struct locator { * @return A reference to a valid service. */ template - [[nodiscard]] static Service &value_or(Args &&...args) ENTT_NOEXCEPT { + [[nodiscard]] static Service &value_or(Args &&...args) { return service ? *service : emplace(std::forward(args)...); } @@ -100,7 +100,7 @@ struct locator { } /*! @brief Resets a service. */ - static void reset() { + static void reset() ENTT_NOEXCEPT { service.reset(); }