From d0873ed551445801384edccb886fe67242ef0c1a Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 15 Feb 2022 10:29:21 +0100 Subject: [PATCH] dense_map: adjust noexcept policy --- src/entt/container/dense_map.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/entt/container/dense_map.hpp b/src/entt/container/dense_map.hpp index 4a0122052..c53ce6726 100644 --- a/src/entt/container/dense_map.hpp +++ b/src/entt/container/dense_map.hpp @@ -57,7 +57,7 @@ public: : it{iter} {} template>, typename = std::enable_if_t> - dense_map_iterator(const dense_map_iterator> *> &other) + dense_map_iterator(const dense_map_iterator> *> &other) ENTT_NOEXCEPT : it{other.it} {} dense_map_iterator &operator++() ENTT_NOEXCEPT { @@ -96,15 +96,15 @@ public: return (*this + -value); } - [[nodiscard]] reference operator[](const difference_type value) const { + [[nodiscard]] reference operator[](const difference_type value) const ENTT_NOEXCEPT { return it[value].element; } - [[nodiscard]] pointer operator->() const { + [[nodiscard]] pointer operator->() const ENTT_NOEXCEPT { return std::addressof(it->element); } - [[nodiscard]] reference operator*() const { + [[nodiscard]] reference operator*() const ENTT_NOEXCEPT { return *operator->(); } @@ -176,7 +176,7 @@ public: offset{pos} {} template>, typename = std::enable_if_t> - dense_map_local_iterator(const dense_map_local_iterator> *> &other) + dense_map_local_iterator(const dense_map_local_iterator> *> &other) ENTT_NOEXCEPT : it{other.it}, offset{other.offset} {} @@ -189,11 +189,11 @@ public: return ++(*this), orig; } - [[nodiscard]] pointer operator->() const { + [[nodiscard]] pointer operator->() const ENTT_NOEXCEPT { return std::addressof(it[offset].element); } - [[nodiscard]] reference operator*() const { + [[nodiscard]] reference operator*() const ENTT_NOEXCEPT { return *operator->(); } @@ -406,14 +406,14 @@ public: * @brief Default move constructor. * @param other The instance to move from. */ - dense_map(dense_map &&other) ENTT_NOEXCEPT = default; + dense_map(dense_map &&other) = default; /** * @brief Allocator-extended move constructor. * @param other The instance to move from. * @param allocator The allocator to use. */ - dense_map(dense_map &&other, const allocator_type &allocator) ENTT_NOEXCEPT + dense_map(dense_map &&other, const allocator_type &allocator) : sparse{sparse_container_type{std::move(other.sparse.first()), allocator}, std::move(other.sparse.second())}, // cannot move the container directly due to a nasty issue of apple clang :( packed{packed_container_type{std::make_move_iterator(other.packed.first().begin()), std::make_move_iterator(other.packed.first().end()), allocator}, std::move(other.packed.second())}, @@ -442,7 +442,7 @@ public: * @param other The instance to move from. * @return This container. */ - dense_map &operator=(dense_map &&other) ENTT_NOEXCEPT = default; + dense_map &operator=(dense_map &&other) = default; /** * @brief Returns the associated allocator.