How would I go about actually calling std::max? The code won't compile in visual studio 2013, because it takes "max" as the macro.
std::max( ... );
Expects an identifier after the "std::".
You can undefine the macro:
#undef max
Edit: It seems the macros can be safely disabled by putting
#define NOMINMAX
before the header files that define them (most likely windef.h
, which you probably include indirectly).
To avoid undefining the macro, you can simply wrap the function in parenthesis
(std::max)(...)
As noted by chris in the comments, function-like macros require the token after the macro name to be a left parenthesis in order to expand. Wrapping the name in parentheses is really just a hack to make the next token a right parenthesis without changing the meaning once you put macros aside.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With