Streams icon indicating copy to clipboard operation
Streams copied to clipboard

undefined min/max in StreamTerminators.h for msvc

Open mesinger opened this issue 6 years ago • 0 comments

Hello, while working on Windows and compiling with MSVC(1921), and using common windows headers, i couldn't compile while using Streams. This is due to the implementation of

inline auto max(Less&& less = Less())

and

inline auto min(Less&& less = Less())

in StreamTerminators.h.
min and max are already defined as macros

#define max(a,b)            (((a) > (b)) ? (a) : (b))

and

#define min(a,b)            (((a) < (b)) ? (a) : (b))

in minwindef.h.
I got it working by first, undefining, and at the end of the file, redefining min and max.

mesinger avatar Jul 31 '19 11:07 mesinger