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

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

#include <stl_extensions.hpp>

Concept definition

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

Detailed Description

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

This is a less restrictive version of the std::equality_comparable_with function.

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