Simple-Utility v2.3.1
Loading...
Searching...
No Matches
sl::concepts::nothrow_weakly_equality_comparable_with Concept Reference

Checks whether a symmetrical set of operators == and != to compare both types with each other exists and has noexcept specifier. More...

#include <stl_extensions.hpp>

Concept definition

template<class T1, class T2>
concept sl::concepts::nothrow_weakly_equality_comparable_with = requires(const std::remove_cvref_t<T1>& t1, const std::remove_cvref_t<T2>& t2)
{
{ t1 == t2 } noexcept -> std::convertible_to<bool>;
{ t1 != t2 } noexcept -> std::convertible_to<bool>;
{ t2 == t1 } noexcept -> std::convertible_to<bool>;
{ t2 != t1 } noexcept -> std::convertible_to<bool>;
}
Checks whether a symmetrical set of operators == and != to compare both types with each other exists ...
Definition: stl_extensions.hpp:140

Detailed Description

Checks whether a symmetrical set of operators == and != to compare both types with each other exists and has noexcept specifier.

This is a less restrictive version of the std::equality_comparable_with function, but with additional noexcept check.

See also
https://en.cppreference.com/w/cpp/concepts/equality_comparable
Template Parameters
T1The first type to check
T2The second type to check