cmdline icon indicating copy to clipboard operation
cmdline copied to clipboard

MSVC confuse std::max with windows max macros

Open howard-scu opened this issue 8 years ago • 0 comments

when i compiled cmdline in vs2016, i got the following error

1>cmdline.h(586) : error C2589: '(' : illegal token on right side of '::'
1>cmdline.h(586) : error C2143: syntax error : missing ';' before '::'

the solution is to use

max_width = (std::max)(max_width, (ordered[i]->name().length()));

to instead the line

max_width = std::max(max_width, (ordered[i]->name().length()));

howard-scu avatar Oct 21 '16 07:10 howard-scu