Num icon indicating copy to clipboard operation
Num copied to clipboard

compile failed

Open peer2peer opened this issue 5 years ago • 2 comments

Several errors while build in visual studio 2019:

1>D:\cpptest\num.hpp(230): error C2589: “(”:“::”

230 size_t i, na = a.size(), nb = b.size(), n = std::max(na, nb);

peer2peer avatar Aug 09 '19 07:08 peer2peer

This is caused by an errant max macro from "windows.h". #undef max or #define NOMINMAX before including it.

Botje avatar Aug 09 '19 09:08 Botje

I believe that the correct solution is to define NOMINMAX in the settings of your visual studio project. Adding fixes for every compiler in every file does not scale.

See https://stackoverflow.com/questions/4913922/possible-problems-with-nominmax-on-visual-c for further discussion and alternative fixes.

983 avatar Jul 14 '22 13:07 983