Reputation: 103
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!
Upvotes: 9
Views: 1573
Reputation: 5335
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
Upvotes: 14