7 #if !defined(CNL_IMPL_CMATH_ABS_H)
8 #define CNL_IMPL_CMATH_ABS_H
10 #include "../numbers/signedness.h"
15 requires(numbers::signedness_v<T>)
16 [[nodiscard]] constexpr
auto abs(T
const& value)
18 static_assert(
std::is_same<decltype(+value), decltype(-value)>::value);
20 return static_cast<T
>((value < 0) ? -value : +value);
24 requires(!numbers::signedness_v<T>)
25 [[nodiscard]] constexpr
auto abs(T
const& value)
32 #endif // CNL_IMPL_CMATH_ABS_H