I have a project here which still needs to build with VS2008 and I've discovered a problem with std::min() and std::max()
The compiler gives me:- error C2589: '(' : illegal token on right side of '::'
std::max() gives the same error but int n = min(2, 1); compiles okay. I'm guessing it's using the wrong versions of min() and max() somehow, although I'm pretty sure std::min() and std::max() were supported back then. Can anyone remember/suggest what the solution was?
Code:
#include <algorithm>
int n = std::min(2, 1);
std::max() gives the same error but int n = min(2, 1); compiles okay. I'm guessing it's using the wrong versions of min() and max() somehow, although I'm pretty sure std::min() and std::max() were supported back then. Can anyone remember/suggest what the solution was?