Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-tidy: replace throw with noexcept #1730

Merged
merged 1 commit into from
Jun 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions include/exiv2/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ namespace Exiv2 {
AnyError() = default;
AnyError(const AnyError& o) = default;

~AnyError() throw() override = default;
~AnyError() noexcept override = default;
///@brief Return the error code.
virtual int code() const throw() =0;
virtual int code() const noexcept = 0;
};

//! %AnyError output operator
Expand Down Expand Up @@ -281,17 +281,17 @@ namespace Exiv2 {
inline BasicError(ErrorCode code, const A& arg1, const B& arg2, const C& arg3);

//! Virtual destructor. (Needed because of throw())
inline ~BasicError() throw() override;
inline ~BasicError() noexcept override;
//@}

//! @name Accessors
//@{
inline int code() const throw() override;
inline int code() const noexcept override;
/*!
@brief Return the error message as a C-string. The pointer returned by what()
is valid only as long as the BasicError object exists.
*/
inline const char* what() const throw() override;
inline const char* what() const noexcept override;
#ifdef EXV_UNICODE_PATH
/*!
@brief Return the error message as a wchar_t-string. The pointer returned by
Expand Down Expand Up @@ -367,16 +367,16 @@ namespace Exiv2 {
}

template <typename charT>
BasicError<charT>::~BasicError() throw() = default;
BasicError<charT>::~BasicError() noexcept = default;

template<typename charT>
int BasicError<charT>::code() const throw()
template <typename charT>
int BasicError<charT>::code() const noexcept
{
return code_;
}

template<typename charT>
const char* BasicError<charT>::what() const throw()
template <typename charT>
const char* BasicError<charT>::what() const noexcept
{
return msg_.c_str();
}
Expand Down
20 changes: 10 additions & 10 deletions include/exiv2/slice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace Exiv2
/*!
* Return the number of elements in the slice.
*/
inline size_t size() const throw()
inline size_t size() const noexcept
{
// cannot underflow, as we know that begin < end
return end_ - begin_;
Expand Down Expand Up @@ -184,15 +184,15 @@ namespace Exiv2
/*!
* Obtain a constant iterator to the first element in the slice.
*/
const_iterator cbegin() const throw()
const_iterator cbegin() const noexcept
{
return storage_.unsafeGetIteratorAt(begin_);
}

/*!
* Obtain a constant iterator to the first beyond the slice.
*/
const_iterator cend() const throw()
const_iterator cend() const noexcept
{
return storage_.unsafeGetIteratorAt(end_);
}
Expand Down Expand Up @@ -273,15 +273,15 @@ namespace Exiv2
/*!
* Obtain an iterator to the first element in the slice.
*/
iterator begin() throw()
iterator begin() noexcept
{
return this->storage_.unsafeGetIteratorAt(this->begin_);
}

/*!
* Obtain an iterator to the first element beyond the slice.
*/
iterator end() throw()
iterator end() noexcept
{
return this->storage_.unsafeGetIteratorAt(this->end_);
}
Expand All @@ -304,7 +304,7 @@ namespace Exiv2
* the appropriate `slice<const T>` and call its `subSlice() const`,
* which returns the correct type.
*/
ConstSliceBase<storage_type, const data_type> to_const_base() const throw()
ConstSliceBase<storage_type, const data_type> to_const_base() const noexcept
{
return ConstSliceBase<storage_type, const data_type>(this->storage_.data_, this->begin_, this->end_);
}
Expand Down Expand Up @@ -442,12 +442,12 @@ namespace Exiv2
*
* @throw nothing
*/
value_type& unsafeAt(size_t index) throw()
value_type& unsafeAt(size_t index) noexcept
{
return data_[index];
}

const value_type& unsafeAt(size_t index) const throw()
const value_type& unsafeAt(size_t index) const noexcept
{
return data_[index];
}
Expand All @@ -458,12 +458,12 @@ namespace Exiv2
*
* @throw nothing
*/
iterator unsafeGetIteratorAt(size_t index) throw()
iterator unsafeGetIteratorAt(size_t index) noexcept
{
return data_ + index;
}

const_iterator unsafeGetIteratorAt(size_t index) const throw()
const_iterator unsafeGetIteratorAt(size_t index) const noexcept
{
return data_ + index;
}
Expand Down