Disambiguation from other max/min functions

Disambiguation from other max/min functions
This commit is contained in:
Teebonne 2022-09-08 20:42:17 +01:00 committed by GitHub
parent fbae8cd6c1
commit 73f518ca98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@ constexpr Number abs(Number val)
/// constexpr max
/// </summary>
template <typename NumberL, typename NumberR>
constexpr typename std::common_type<NumberL, NumberR>::type max(NumberL lval, NumberR rval)
constexpr typename std::common_type<NumberL, NumberR>::type (max)(NumberL lval, NumberR rval)
{
return (lval < rval) ? rval : lval;
}
@ -60,7 +60,7 @@ constexpr typename std::common_type<NumberL, NumberR>::type max(NumberL lval, Nu
/// constexpr min
/// </summary>
template <typename NumberL, typename NumberR>
constexpr typename std::common_type<NumberL, NumberR>::type min(NumberL lval, NumberR rval)
constexpr typename std::common_type<NumberL, NumberR>::type (min)(NumberL lval, NumberR rval)
{
return (lval < rval) ? lval : rval;
}