Iros
 
Loading...
Searching...
No Matches
cmp_equal.h
Go to the documentation of this file.
1#pragma once
2
3#include "di/meta/language.h"
4
5namespace di::math {
6namespace detail {
8 template<concepts::Integral T, concepts::Integral U>
9 constexpr auto operator()(T a, U b) const -> bool {
10 using UT = meta::MakeUnsigned<T>;
11 using UU = meta::MakeUnsigned<U>;
13 return a == b;
14 } else if constexpr (concepts::Signed<T>) {
15 return a < 0 ? false : UT(a) == b;
16 } else {
17 return b < 0 ? false : a == UU(b);
18 }
19 }
20 };
21}
22
23constexpr inline auto cmp_equal = detail::CmpEqualFunction {};
24}
Definition language.h:238
Definition abs.h:11
Definition abs.h:10
constexpr auto cmp_equal
Definition cmp_equal.h:23
detail::MakeUnsignedHelper< RemoveCV< T > >::Type MakeUnsigned
Definition language.h:362
Definition cmp_equal.h:7
constexpr auto operator()(T a, U b) const -> bool
Definition cmp_equal.h:9