Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3021

[RESOLVED] Namespace problem with older version of MSVC

$
0
0
I have a project here which still needs to build with VS2008 and I've discovered a problem with std::min() and std::max()

Code:

#include <algorithm>

int n = std::min(2, 1);

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?

Viewing all articles
Browse latest Browse all 3021

Trending Articles