Tessil / ordered-map

C++ hash map and hash set which preserve the order of insertion
MIT License
512 stars 66 forks source link

Conflict with `Windows.h` #35

Closed MartinKoch123 closed 2 years ago

MartinKoch123 commented 2 years ago

Hello, the following does not compile with VS2019:

#include <Windows.h>
#include <ordered_map.h>
int main() {}

grafik

Switching the include order works however. Im not a C++ expert but it seemed worth pointing out.

Tessil commented 2 years ago

Hello,

It's due to Windows.h that historically defines min/max macros which are incompatible with the C++ standard. The best way is to define the NOMINMAX macro in your project. See https://stackoverflow.com/questions/11544073/how-do-i-deal-with-the-max-macro-in-windows-h-colliding-with-max-in-std for details.