I found code in boost similar to:
class A
{
stats stat;
public:
int min() const{ return (stat.min)(); }
};
...
int stats::min()
{
...
}
Why are parenthesis here? I know that it can be used for "most vexing parse" and to prohibit ADL. But maybe something else? Thanks in advance!
It's done because windows.h (Windows platform) has #defines for both min and max. See here for more info: How to tame the Windows headers (useful defines)? and https://stackoverflow.com/a/13420838/297451
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