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.44k stars 308 forks source link

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

Open northstarvn opened 2 days ago

northstarvn commented 2 days 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 2 days 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