Iros
 
Loading...
Searching...
No Matches
cmp_less.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::Integer T, concepts::Integer 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 ? true : UT(a) < b;
16 } else {
17 return b < 0 ? false : a < UU(b);
18 }
19 }
20 };
21}
22
23constexpr inline auto cmp_less = detail::CmpLessFunction {};
24}
Definition language.h:238
Definition abs.h:11
Definition abs.h:10
constexpr auto cmp_less
Definition cmp_less.h:23
detail::MakeUnsignedHelper< RemoveCV< T > >::Type MakeUnsigned
Definition language.h:362
Definition cmp_less.h:7
constexpr auto operator()(T a, U b) const -> bool
Definition cmp_less.h:9