Skip to content

Commit

Permalink
Remove noexcept clauses from visit methods
Browse files Browse the repository at this point in the history
  • Loading branch information
raguridan authored and dsarmany committed Aug 9, 2024
1 parent 0f0ab46 commit 897bd4a
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions src/multio/message/MetadataValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,37 +54,18 @@ class MetadataValue : public MetadataValueVariant {
//
// Static cast to base class is done because gcc had a bug with visiting derived classes:
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90943 Not required for gcc12
#if defined(__GNUC__) && (__GNUC__ < 9)
template <typename F>
decltype(auto) visit(F&& f) const&
#else
template <typename F>
decltype(auto) visit(F&& f) const& noexcept(noexcept(util::visitUnwrapUniquePtr(std::forward<F>(f), *this)))
#endif
{
decltype(auto) visit(F&& f) const& {
return util::visitUnwrapUniquePtr(std::forward<F>(f), *this);
}

#if defined(__GNUC__) && (__GNUC__ < 9)
template <typename F>
decltype(auto) visit(F&& f) &
#else
template <typename F>
decltype(auto) visit(F&& f) & noexcept(noexcept(util::visitUnwrapUniquePtr(std::forward<F>(f), *this)))
#endif
{
decltype(auto) visit(F&& f) & {
return util::visitUnwrapUniquePtr(std::forward<F>(f), *this);
}

#if defined(__GNUC__) && (__GNUC__ < 9)
template <typename F>
decltype(auto) visit(F&& f) &&
#else
template <typename F>
decltype(auto) visit(F&& f) && noexcept(noexcept(util::visitUnwrapUniquePtr(std::forward<F>(f),
std::move(*this))))
#endif
{
decltype(auto) visit(F&& f) && {
return util::visitUnwrapUniquePtr(std::forward<F>(f), std::move(*this));
}

Expand Down

0 comments on commit 897bd4a

Please sign in to comment.