std::min is a function template on T which is the type of both parameters of the function. But you seem to pass function arguments of different type, and rely on template argument deduction from function arguments, which is not possible.
So the fix is :
-
Either don’t rely on template argument deduction, instead explicitly mention the template argument:
std::min<unsigned long>(ulongarg, uintarg); //ok //^^^^^^^^^^^^^^^ //don't rely on template argument deduction //instead pass template argument explicitly. -
Or pass function arguments of same type:
std::min(ulongarg, static_cast<unsigned long>(uintarg)); //ok //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //pass both arguments of same type