hosseinmoein / DataFrame

C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ using native types and contiguous memory storage
https://hosseinmoein.github.io/DataFrame/
BSD 3-Clause "New" or "Revised" License
2.53k stars 314 forks source link

std::max causing syntax error if not put in parentheses #328

Closed northstarvn closed 1 month ago

northstarvn commented 1 month ago

I wonder if it's a problem of MSVC and how to avoid mass code changes to compile successfully? everywhere a max, min like that has the same issue. E.g must wrap parentheses like this (std::numeric_limits::max)()

hosseinmoein commented 1 month ago

Yes, this is because of the stupid Windows historical definition of min/max. My original solution was

#ifdef _WIN32 && max
  undef max
#endif

But another contributor solved it better. If you include the DataFrame.h, it should just work with CMake