diff --git a/src/tag/Tag.cxx b/src/tag/Tag.cxx index 4bf4751bd..169af0d71 100644 --- a/src/tag/Tag.cxx +++ b/src/tag/Tag.cxx @@ -40,7 +40,7 @@ Tag::Clear() noexcept num_items = 0; } -Tag::Tag(const Tag &other) +Tag::Tag(const Tag &other) noexcept :duration(other.duration), has_playlist(other.has_playlist), num_items(other.num_items), items(nullptr) @@ -64,7 +64,7 @@ Tag::Merge(const Tag &base, const Tag &add) noexcept } std::unique_ptr -Tag::Merge(std::unique_ptr base, std::unique_ptr add) +Tag::Merge(std::unique_ptr base, std::unique_ptr add) noexcept { if (add == nullptr) return base; diff --git a/src/tag/Tag.hxx b/src/tag/Tag.hxx index be69017a8..4a12dde16 100644 --- a/src/tag/Tag.hxx +++ b/src/tag/Tag.hxx @@ -56,9 +56,9 @@ struct Tag { */ Tag() = default; - Tag(const Tag &other); + Tag(const Tag &other) noexcept; - Tag(Tag &&other) + Tag(Tag &&other) noexcept :duration(other.duration), has_playlist(other.has_playlist), num_items(other.num_items), items(other.items) { other.items = nullptr; @@ -68,13 +68,13 @@ struct Tag { /** * Free the tag object and all its items. */ - ~Tag() { + ~Tag() noexcept { Clear(); } Tag &operator=(const Tag &other) = delete; - Tag &operator=(Tag &&other) { + Tag &operator=(Tag &&other) noexcept { duration = other.duration; has_playlist = other.has_playlist; MoveItemsFrom(std::move(other)); @@ -126,7 +126,7 @@ struct Tag { * @return a newly allocated tag */ static std::unique_ptr Merge(std::unique_ptr base, - std::unique_ptr add); + std::unique_ptr add) noexcept; /** * Returns the first value of the specified tag type, or @@ -155,52 +155,52 @@ struct Tag { friend struct Tag; const TagItem *const*cursor; - constexpr const_iterator(const TagItem *const*_cursor) + constexpr const_iterator(const TagItem *const*_cursor) noexcept :cursor(_cursor) {} public: - constexpr const TagItem &operator*() const { + constexpr const TagItem &operator*() const noexcept { return **cursor; } - constexpr const TagItem *operator->() const { + constexpr const TagItem *operator->() const noexcept { return *cursor; } - const_iterator &operator++() { + const_iterator &operator++() noexcept { ++cursor; return *this; } - const_iterator operator++(int) { + const_iterator operator++(int) noexcept { auto result = cursor++; return const_iterator{result}; } - const_iterator &operator--() { + const_iterator &operator--() noexcept { --cursor; return *this; } - const_iterator operator--(int) { + const_iterator operator--(int) noexcept { auto result = cursor--; return const_iterator{result}; } - constexpr bool operator==(const_iterator other) const { + constexpr bool operator==(const_iterator other) const noexcept { return cursor == other.cursor; } - constexpr bool operator!=(const_iterator other) const { + constexpr bool operator!=(const_iterator other) const noexcept { return cursor != other.cursor; } }; - const_iterator begin() const { + const_iterator begin() const noexcept { return const_iterator{items}; } - const_iterator end() const { + const_iterator end() const noexcept { return const_iterator{items + num_items}; } }; diff --git a/test/test_queue_priority.cxx b/test/test_queue_priority.cxx index 42a5e7224..3282b4219 100644 --- a/test/test_queue_priority.cxx +++ b/test/test_queue_priority.cxx @@ -8,7 +8,7 @@ #include #include -Tag::Tag(const Tag &) {} +Tag::Tag(const Tag &) noexcept {} void Tag::Clear() noexcept {} static void