mirror of
https://github.com/ETLCPP/etl.git
synced 2026-10-28 18:07:10 +08:00
Remove redundant noexcept expr (#1542)
Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
This commit is contained in:
parent
d9d312f671
commit
1fd302e168
@ -384,7 +384,7 @@ namespace etl
|
||||
/// constructor.
|
||||
//***************************************************************************
|
||||
template <typename... TArgs>
|
||||
typed_storage(TArgs&&... args) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
|
||||
typed_storage(TArgs&&... args)
|
||||
: valid(false)
|
||||
{
|
||||
create(etl::forward<TArgs>(args)...);
|
||||
@ -456,7 +456,7 @@ namespace etl
|
||||
/// the internal byte array.
|
||||
//***************************************************************************
|
||||
template <typename... TArgs>
|
||||
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<TArgs>(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<T*>(pbuffer_))
|
||||
, valid(false)
|
||||
{
|
||||
@ -633,7 +633,7 @@ namespace etl
|
||||
/// constructor.
|
||||
//***************************************************************************
|
||||
template <typename... TArgs>
|
||||
typed_storage_ext(void* pbuffer_, TArgs&&... args) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
|
||||
typed_storage_ext(void* pbuffer_, TArgs&&... args)
|
||||
: pbuffer(reinterpret_cast<T*>(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<T>&& other) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
|
||||
typed_storage_ext(typed_storage_ext<T>&& other)
|
||||
: pbuffer(other.pbuffer)
|
||||
, valid(other.valid)
|
||||
{
|
||||
@ -727,7 +727,7 @@ namespace etl
|
||||
/// the external buffer.
|
||||
//***************************************************************************
|
||||
template <typename... TArgs>
|
||||
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<TArgs>(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->();
|
||||
}
|
||||
|
||||
@ -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));
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -185,7 +185,7 @@ namespace etl
|
||||
///\param slot: The slot to connect.
|
||||
///\return <b>false</b> 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 <b>false</b> if not all slots could be connected.
|
||||
//*************************************************************************
|
||||
bool connect(std::initializer_list<const slot_type> slots) ETL_NOEXCEPT_EXPR(ETL_NOT_USING_EXCEPTIONS)
|
||||
bool connect(std::initializer_list<const slot_type> slots)
|
||||
{
|
||||
for (const slot_type& slot : slots)
|
||||
{
|
||||
@ -226,7 +226,7 @@ namespace etl
|
||||
///\param slots: etl::span of slots to connect.
|
||||
///\return <b>false</b> 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)
|
||||
{
|
||||
|
||||
@ -249,7 +249,7 @@ namespace etl
|
||||
/// Construct from iterator + size
|
||||
//*************************************************************************
|
||||
template <typename TIterator>
|
||||
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 <typename TIteratorBegin, typename TIteratorEnd>
|
||||
ETL_CONSTEXPR14 span(const TIteratorBegin begin_, const TIteratorEnd end_,
|
||||
typename etl::enable_if< !etl::is_integral<TIteratorEnd>::value, void>::type* = 0) ETL_NOEXCEPT_IF(ETL_NOT_USING_EXCEPTIONS)
|
||||
typename etl::enable_if< !etl::is_integral<TIteratorEnd>::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<TContainer>::type&>().data()), pointer>::value
|
||||
&& etl::is_same< typename etl::remove_cv<T>::type,
|
||||
typename etl::remove_cv<typename etl::remove_reference< TContainer>::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));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user