The windows.h header checks for the macro NOMINMAX and does not define the min and max macros if it finds it. Unfortunatelly wincore.h defines them anyway and breaks havoc in out template functions. Can you please either respect this macro or define these just for Dev-C++ ?
I'll add sport for the NOMINMAX macro in the next version.
In the meantime, if you wish to use the template version of min or max, you can specify them as follows:
int x = std::max<int>(i,j);
Its not a bad idea to use the template versions of min/max like this in any case, as the compiler will then provide a warning if you mistakenly compare variables of a different type.
I've elected to remove the macro definitions for min and max within Win32++, and add macros for MIN and MAX.
This approach has the following advantages:
* The names don't conflict with std::min and std::max
* They fit neatly with all supported compilers including Dev-C++ (which doesn't define min and max macros) and VS6 (which doesn't support std::min or std::max)
* The new names are consistant with macro naming conventions
* The change has minimal inpact on backwards compatibility. Only Dev-C++ users will be affected, and they can use MIN/MAX in place of min/max.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.