Closed Cerclique closed 2 years ago
Yes, this is a known problem with the Windows headers. Honestly, I think this a problem with the Windows SDK and not worth noting in every possible project that uses standard-compliant C++.
Note that you can #define NOMINMAX
before including any Windows headers to fix this without relying on include order. Will that solve this issue for you as well?
Yes, you are totally right.
I just noticed that I forgot to mention NOMINMAX
as well that, indeed, also solve the issue.
Window's header
minwindef.h
define the macromin()
andmax()
.When this file is included before
fixed.hpp
, this fail to compile becausemin/max
method ofnumeric_limit<fixed>
are refering to the windows macro as showed in the screenshot below.I did not look that much into the subject but it seems to be a reccurent problem for libraries that are using
min/max
methods and are co-existing with the windows header in an application.The solution I use for now is the include
fixed.hpp
before the header that includeminwindef.h
.I think, this information might be worth to be included as a note in the documentation or somewhere else.