Skip to content

Commit

Permalink
Merge branch 'FixKlocworkFindings' into 'master'
Browse files Browse the repository at this point in the history
Added noexcept specifier to all comparison operators

See merge request rmettler/cpp_delegates!16
  • Loading branch information
rmettler committed Oct 14, 2024
2 parents 212cdba + b4a4bd3 commit fd6ebbb
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions include/rome/delegate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,16 +522,16 @@ class delegate<Ret(Args...), Behavior>
using base_type::operator();
using base_type::create;

friend constexpr auto operator==(const delegate& lhs, std::nullptr_t) -> bool {
friend constexpr auto operator==(const delegate& lhs, std::nullptr_t) noexcept -> bool {
return !lhs;
}
friend constexpr auto operator==(std::nullptr_t, const delegate& rhs) -> bool {
friend constexpr auto operator==(std::nullptr_t, const delegate& rhs) noexcept -> bool {
return !rhs;
}
friend constexpr auto operator!=(const delegate& lhs, std::nullptr_t) -> bool {
friend constexpr auto operator!=(const delegate& lhs, std::nullptr_t) noexcept -> bool {
return static_cast<bool>(lhs);
}
friend constexpr auto operator!=(std::nullptr_t, const delegate& rhs) -> bool {
friend constexpr auto operator!=(std::nullptr_t, const delegate& rhs) noexcept -> bool {
return static_cast<bool>(rhs);
}
};
Expand Down Expand Up @@ -571,16 +571,16 @@ class delegate<Ret(Args...), target_is_mandatory>
using base_type::operator();
using base_type::create;

friend constexpr auto operator==(const delegate& lhs, std::nullptr_t) -> bool {
friend constexpr auto operator==(const delegate& lhs, std::nullptr_t) noexcept -> bool {
return !lhs;
}
friend constexpr auto operator==(std::nullptr_t, const delegate& rhs) -> bool {
friend constexpr auto operator==(std::nullptr_t, const delegate& rhs) noexcept -> bool {
return !rhs;
}
friend constexpr auto operator!=(const delegate& lhs, std::nullptr_t) -> bool {
friend constexpr auto operator!=(const delegate& lhs, std::nullptr_t) noexcept -> bool {
return static_cast<bool>(lhs);
}
friend constexpr auto operator!=(std::nullptr_t, const delegate& rhs) -> bool {
friend constexpr auto operator!=(std::nullptr_t, const delegate& rhs) noexcept -> bool {
return static_cast<bool>(rhs);
}
};
Expand Down Expand Up @@ -650,16 +650,16 @@ class fwd_delegate<void(Args...), Behavior>
using base_type::operator();
using base_type::create;

friend constexpr auto operator==(const fwd_delegate& lhs, std::nullptr_t) -> bool {
friend constexpr auto operator==(const fwd_delegate& lhs, std::nullptr_t) noexcept -> bool {
return !lhs;
}
friend constexpr auto operator==(std::nullptr_t, const fwd_delegate& rhs) -> bool {
friend constexpr auto operator==(std::nullptr_t, const fwd_delegate& rhs) noexcept -> bool {
return !rhs;
}
friend constexpr auto operator!=(const fwd_delegate& lhs, std::nullptr_t) -> bool {
friend constexpr auto operator!=(const fwd_delegate& lhs, std::nullptr_t) noexcept -> bool {
return static_cast<bool>(lhs);
}
friend constexpr auto operator!=(std::nullptr_t, const fwd_delegate& rhs) -> bool {
friend constexpr auto operator!=(std::nullptr_t, const fwd_delegate& rhs) noexcept -> bool {
return static_cast<bool>(rhs);
}
};
Expand Down Expand Up @@ -706,16 +706,16 @@ class fwd_delegate<void(Args...), target_is_mandatory>
using base_type::operator();
using base_type::create;

friend constexpr auto operator==(const fwd_delegate& lhs, std::nullptr_t) -> bool {
friend constexpr auto operator==(const fwd_delegate& lhs, std::nullptr_t) noexcept -> bool {
return !lhs;
}
friend constexpr auto operator==(std::nullptr_t, const fwd_delegate& rhs) -> bool {
friend constexpr auto operator==(std::nullptr_t, const fwd_delegate& rhs) noexcept -> bool {
return !rhs;
}
friend constexpr auto operator!=(const fwd_delegate& lhs, std::nullptr_t) -> bool {
friend constexpr auto operator!=(const fwd_delegate& lhs, std::nullptr_t) noexcept -> bool {
return static_cast<bool>(lhs);
}
friend constexpr auto operator!=(std::nullptr_t, const fwd_delegate& rhs) -> bool {
friend constexpr auto operator!=(std::nullptr_t, const fwd_delegate& rhs) noexcept -> bool {
return static_cast<bool>(rhs);
}
};
Expand Down

0 comments on commit fd6ebbb

Please sign in to comment.