mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Align comparison operators (#1330)
In functional.h, the comparison operators for equal_to and not_equal_to mismatch between the actual comparison execution and the type inference for the return type. This change adjusts it by using the same operator==() in the return type inference as used in the comparison execution. Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
This commit is contained in:
parent
4ad6126ec5
commit
7329efc7df
@ -303,7 +303,7 @@ namespace etl
|
||||
typedef int is_transparent;
|
||||
|
||||
template <typename T1, typename T2>
|
||||
constexpr auto operator()(T1&& lhs, T2&& rhs) const -> decltype(static_cast<T1&&>(lhs) < static_cast<T2&&>(rhs))
|
||||
constexpr auto operator()(T1&& lhs, T2&& rhs) const -> decltype(static_cast<T1&&>(lhs) == static_cast<T2&&>(rhs))
|
||||
{
|
||||
return static_cast<T1&&>(lhs) == static_cast<T2&&>(rhs);
|
||||
}
|
||||
@ -329,7 +329,7 @@ namespace etl
|
||||
typedef int is_transparent;
|
||||
|
||||
template <typename T1, typename T2>
|
||||
constexpr auto operator()(T1&& lhs, T2&& rhs) const -> decltype(static_cast<T1&&>(lhs) < static_cast<T2&&>(rhs))
|
||||
constexpr auto operator()(T1&& lhs, T2&& rhs) const -> decltype(!(static_cast<T1&&>(lhs) == static_cast<T2&&>(rhs)))
|
||||
{
|
||||
return !(static_cast<T1&&>(lhs) == static_cast<T2&&>(rhs));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user