I'm trying to create aliases for std::min
and std::max
functions based on this answer, but if I try the following code:
#include <algorithm>
namespace math
{
template< typename T >
constexpr auto Max = std::max< T >;
}
and try to run such example:
constexpr int a = 2;
constexpr int b = 3;
constexpr int max = math::Max( a, b );
I get this error:
error C3245: 'math::Max': use of a variable template requires template argument list
What is the best way in modern C++ to do this correctly?