Num
Num copied to clipboard
compile failed
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);
This is caused by an errant max
macro from "windows.h". #undef max
or #define NOMINMAX
before including it.
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.