From 1fd302e168ea51ffe9610734034225e526ae4a24 Mon Sep 17 00:00:00 2001 From: Mike Bloom <91038685+mike919192@users.noreply.github.com> Date: Mon, 10 Aug 2026 05:07:58 -0400 Subject: [PATCH] Remove redundant noexcept expr (#1542) Co-authored-by: John Wellbelove --- include/etl/alignment.h | 28 ++++++++++++++-------------- include/etl/array.h | 4 ++-- include/etl/not_null.h | 12 ++++++------ include/etl/signal.h | 6 +++--- include/etl/span.h | 6 +++--- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/etl/alignment.h b/include/etl/alignment.h index 023acac2..89412503 100644 --- a/include/etl/alignment.h +++ b/include/etl/alignment.h @@ -384,7 +384,7 @@ namespace etl /// constructor. //*************************************************************************** template - typed_storage(TArgs&&... args) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + typed_storage(TArgs&&... args) : valid(false) { create(etl::forward(args)...); @@ -456,7 +456,7 @@ namespace etl /// the internal byte array. //*************************************************************************** template - reference create(TArgs&&... args) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + reference create(TArgs&&... args) { ETL_ASSERT(!has_value(), ETL_ERROR(etl::typed_storage_error)); pointer p = ::new (&storage.value) value_type(etl::forward(args)...); @@ -536,7 +536,7 @@ namespace etl //*************************************************************************** /// \returns a pointer of type T and asserts if has_value() is false. //*************************************************************************** - pointer operator->() ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + pointer operator->() { ETL_ASSERT(has_value(), ETL_ERROR(etl::typed_storage_error)); @@ -546,7 +546,7 @@ namespace etl //*************************************************************************** /// \returns a const pointer of type T and asserts if has_value() is false. //*************************************************************************** - const_pointer operator->() const ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + const_pointer operator->() const { ETL_ASSERT(has_value(), ETL_ERROR(etl::typed_storage_error)); @@ -556,7 +556,7 @@ namespace etl //*************************************************************************** /// \returns reference of type T and asserts if has_value() is false. //*************************************************************************** - reference operator*() ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + reference operator*() { return *operator->(); } @@ -564,7 +564,7 @@ namespace etl //*************************************************************************** /// \returns const_reference of type T and asserts if has_value() is false. //*************************************************************************** - const_reference operator*() const ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + const_reference operator*() const { return *operator->(); } @@ -620,7 +620,7 @@ namespace etl //*************************************************************************** /// Constructor. //*************************************************************************** - typed_storage_ext(void* pbuffer_) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + typed_storage_ext(void* pbuffer_) : pbuffer(reinterpret_cast(pbuffer_)) , valid(false) { @@ -633,7 +633,7 @@ namespace etl /// constructor. //*************************************************************************** template - typed_storage_ext(void* pbuffer_, TArgs&&... args) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + typed_storage_ext(void* pbuffer_, TArgs&&... args) : pbuffer(reinterpret_cast(pbuffer_)) , valid(false) { @@ -645,7 +645,7 @@ namespace etl /// Move constructor. /// Transfers ownership of the buffer from \p other to this. //*************************************************************************** - typed_storage_ext(typed_storage_ext&& other) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + typed_storage_ext(typed_storage_ext&& other) : pbuffer(other.pbuffer) , valid(other.valid) { @@ -727,7 +727,7 @@ namespace etl /// the external buffer. //*************************************************************************** template - reference create(TArgs&&... args) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + reference create(TArgs&&... args) { ETL_ASSERT(!has_value(), ETL_ERROR(etl::typed_storage_error)); pointer p = ::new (pbuffer) value_type(etl::forward(args)...); @@ -807,7 +807,7 @@ namespace etl //*************************************************************************** /// \returns a pointer of type T and asserts if has_value() is false. //*************************************************************************** - pointer operator->() ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + pointer operator->() { ETL_ASSERT(has_value(), ETL_ERROR(etl::typed_storage_error)); @@ -817,7 +817,7 @@ namespace etl //*************************************************************************** /// \returns a const pointer of type T and asserts if has_value() is false. //*************************************************************************** - const_pointer operator->() const ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + const_pointer operator->() const { ETL_ASSERT(has_value(), ETL_ERROR(etl::typed_storage_error)); @@ -827,7 +827,7 @@ namespace etl //*************************************************************************** /// \returns reference of type T and asserts if has_value() is false. //*************************************************************************** - reference operator*() ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + reference operator*() { return *operator->(); } @@ -835,7 +835,7 @@ namespace etl //*************************************************************************** /// \returns const_reference of type T and asserts if has_value() is false. //*************************************************************************** - const_reference operator*() const ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + const_reference operator*() const { return *operator->(); } diff --git a/include/etl/array.h b/include/etl/array.h index 82ad5846..1662419b 100644 --- a/include/etl/array.h +++ b/include/etl/array.h @@ -114,7 +114,7 @@ namespace etl /// Returns a reference to the value at index 'i'. ///\param i The index of the element to access. //************************************************************************* - ETL_NODISCARD ETL_CONSTEXPR14 reference at(size_t i) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + ETL_NODISCARD ETL_CONSTEXPR14 reference at(size_t i) { ETL_ASSERT(i < SIZE, ETL_ERROR(array_out_of_range)); @@ -125,7 +125,7 @@ namespace etl /// Returns a const reference to the value at index 'i'. ///\param i The index of the element to access. //************************************************************************* - ETL_NODISCARD ETL_CONSTEXPR14 const_reference at(size_t i) const ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + ETL_NODISCARD ETL_CONSTEXPR14 const_reference at(size_t i) const { ETL_ASSERT(i < SIZE, ETL_ERROR(array_out_of_range)); diff --git a/include/etl/not_null.h b/include/etl/not_null.h index 25823d68..dc1ada2f 100644 --- a/include/etl/not_null.h +++ b/include/etl/not_null.h @@ -46,7 +46,7 @@ namespace etl { public: - not_null_exception(string_type reason_, string_type file_name_, numeric_type line_number_) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + not_null_exception(string_type reason_, string_type file_name_, numeric_type line_number_) : exception(reason_, file_name_, line_number_) { } @@ -59,7 +59,7 @@ namespace etl { public: - not_null_contains_null(string_type file_name_, numeric_type line_number_) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + not_null_contains_null(string_type file_name_, numeric_type line_number_) : not_null_exception(ETL_ERROR_TEXT("not_null:contains null", ETL_NOT_NULL_FILE_ID"A"), file_name_, line_number_) { } @@ -92,7 +92,7 @@ namespace etl /// Constructs a not_null from a pointer. /// Asserts if the pointer is null. //********************************* - ETL_CONSTEXPR14 explicit not_null(underlying_type ptr_) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + ETL_CONSTEXPR14 explicit not_null(underlying_type ptr_) : ptr(ptr_) { ETL_ASSERT(ptr_ != ETL_NULLPTR, ETL_ERROR(not_null_contains_null)); @@ -110,7 +110,7 @@ namespace etl /// Assignment from a pointer. /// Asserts if the pointer is null. //********************************* - ETL_CONSTEXPR14 not_null& operator=(underlying_type rhs) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + ETL_CONSTEXPR14 not_null& operator=(underlying_type rhs) { ETL_ASSERT_OR_RETURN_VALUE(rhs != ETL_NULLPTR, ETL_ERROR(not_null_contains_null), *this); @@ -193,7 +193,7 @@ namespace etl /// Asserts if the unique_ptr contains null. /// Moves from the unique_ptr. //********************************* - ETL_CONSTEXPR14 explicit not_null(underlying_type&& u_ptr_) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + ETL_CONSTEXPR14 explicit not_null(underlying_type&& u_ptr_) : u_ptr(etl::move(u_ptr_)) { ETL_ASSERT(u_ptr.get() != ETL_NULLPTR, ETL_ERROR(not_null_contains_null)); @@ -204,7 +204,7 @@ namespace etl /// Asserts if the unique_ptr contains null. /// Moves from the unique_ptr. //********************************* - ETL_CONSTEXPR14 not_null& operator=(underlying_type&& rhs) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + ETL_CONSTEXPR14 not_null& operator=(underlying_type&& rhs) { ETL_ASSERT_OR_RETURN_VALUE(rhs.get() != ETL_NULLPTR, ETL_ERROR(not_null_contains_null), *this); diff --git a/include/etl/signal.h b/include/etl/signal.h index b78e7e58..695bd0c1 100644 --- a/include/etl/signal.h +++ b/include/etl/signal.h @@ -185,7 +185,7 @@ namespace etl ///\param slot: The slot to connect. ///\return false if not all slots could be connected. //************************************************************************* - bool connect(const slot_type& slot) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + bool connect(const slot_type& slot) { if (!connected(slot)) { @@ -204,7 +204,7 @@ namespace etl ///\param slots: std::initializer_list of slots to connect. ///\return false if not all slots could be connected. //************************************************************************* - bool connect(std::initializer_list slots) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + bool connect(std::initializer_list slots) { for (const slot_type& slot : slots) { @@ -226,7 +226,7 @@ namespace etl ///\param slots: etl::span of slots to connect. ///\return false if not all slots could be connected. //************************************************************************* - bool connect(const span_type slots) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS) + bool connect(const span_type slots) { for (const slot_type& slot : slots) { diff --git a/include/etl/span.h b/include/etl/span.h index 3d5da1c2..b0f7aaf8 100644 --- a/include/etl/span.h +++ b/include/etl/span.h @@ -249,7 +249,7 @@ namespace etl /// Construct from iterator + size //************************************************************************* template - explicit ETL_CONSTEXPR14 span(const TIterator begin_, const size_t size_) ETL_NOEXCEPT_IF(ETL_NOT_USING_EXCEPTIONS) + explicit ETL_CONSTEXPR14 span(const TIterator begin_, const size_t size_) : pbegin(etl::to_address(begin_)) { ETL_ASSERT(size_ == Extent, ETL_ERROR(span_size_mismatch)); @@ -261,7 +261,7 @@ namespace etl //************************************************************************* template ETL_CONSTEXPR14 span(const TIteratorBegin begin_, const TIteratorEnd end_, - typename etl::enable_if< !etl::is_integral::value, void>::type* = 0) ETL_NOEXCEPT_IF(ETL_NOT_USING_EXCEPTIONS) + typename etl::enable_if< !etl::is_integral::value, void>::type* = 0) : pbegin(etl::to_address(begin_)) { ETL_ASSERT(etl::distance(begin_, end_) == Extent, ETL_ERROR(span_size_mismatch)); @@ -293,7 +293,7 @@ namespace etl && etl::is_convertible< decltype(etl::declval< typename etl::remove_reference::type&>().data()), pointer>::value && etl::is_same< typename etl::remove_cv::type, typename etl::remove_cv::type::value_type>::type>::value, - void>::type* = 0) ETL_NOEXCEPT_IF(ETL_NOT_USING_EXCEPTIONS) + void>::type* = 0) : pbegin(a.data()) { ETL_ASSERT(a.size() == Extent, ETL_ERROR(span_size_mismatch));