From a5ce90b268e2eac089b22b6b97ea97a8b15aedc1 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Tue, 17 Sep 2024 11:12:10 +0200 Subject: [PATCH] core: noexcept-ness review --- src/entt/core/compressed_pair.hpp | 10 +++++----- src/entt/core/iterator.hpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/entt/core/compressed_pair.hpp b/src/entt/core/compressed_pair.hpp index 6bb48a07cd..4daeef2dad 100644 --- a/src/entt/core/compressed_pair.hpp +++ b/src/entt/core/compressed_pair.hpp @@ -111,13 +111,13 @@ class compressed_pair final * @brief Copy constructor. * @param other The instance to copy from. */ - constexpr compressed_pair(const compressed_pair &other) noexcept(std::is_nothrow_copy_constructible_v && std::is_nothrow_copy_constructible_v) = default; + constexpr compressed_pair(const compressed_pair &other) = default; /** * @brief Move constructor. * @param other The instance to move from. */ - constexpr compressed_pair(compressed_pair &&other) noexcept(std::is_nothrow_move_constructible_v && std::is_nothrow_move_constructible_v) = default; + constexpr compressed_pair(compressed_pair &&other) noexcept = default; /** * @brief Constructs a pair from its values. @@ -151,14 +151,14 @@ class compressed_pair final * @param other The instance to copy from. * @return This compressed pair object. */ - constexpr compressed_pair &operator=(const compressed_pair &other) noexcept(std::is_nothrow_copy_assignable_v && std::is_nothrow_copy_assignable_v) = default; + constexpr compressed_pair &operator=(const compressed_pair &other) = default; /** * @brief Move assignment operator. * @param other The instance to move from. * @return This compressed pair object. */ - constexpr compressed_pair &operator=(compressed_pair &&other) noexcept(std::is_nothrow_move_assignable_v && std::is_nothrow_move_assignable_v) = default; + constexpr compressed_pair &operator=(compressed_pair &&other) noexcept = default; /** * @brief Returns the first element that a pair stores. @@ -190,7 +190,7 @@ class compressed_pair final * @brief Swaps two compressed pair objects. * @param other The compressed pair to swap with. */ - constexpr void swap(compressed_pair &other) noexcept(std::is_nothrow_swappable_v && std::is_nothrow_swappable_v) { + constexpr void swap(compressed_pair &other) noexcept { using std::swap; swap(first(), other.first()); swap(second(), other.second()); diff --git a/src/entt/core/iterator.hpp b/src/entt/core/iterator.hpp index 42db97ef6c..6bbbd5f8df 100644 --- a/src/entt/core/iterator.hpp +++ b/src/entt/core/iterator.hpp @@ -147,7 +147,7 @@ struct iterable_adaptor final { using sentinel = Sentinel; /*! @brief Default constructor. */ - constexpr iterable_adaptor() noexcept(std::is_nothrow_default_constructible_v &&std::is_nothrow_default_constructible_v) + constexpr iterable_adaptor() noexcept(std::is_nothrow_default_constructible_v && std::is_nothrow_default_constructible_v) : first{}, last{} {} @@ -156,7 +156,7 @@ struct iterable_adaptor final { * @param from Begin iterator. * @param to End iterator. */ - constexpr iterable_adaptor(iterator from, sentinel to) noexcept(std::is_nothrow_move_constructible_v &&std::is_nothrow_move_constructible_v) + constexpr iterable_adaptor(iterator from, sentinel to) noexcept(std::is_nothrow_move_constructible_v && std::is_nothrow_move_constructible_v) : first{std::move(from)}, last{std::move(to)} {}