I believe that the different defines are because in default mode, MSC is not 100% compliant with C++ standard and is a little more allowing than it should be. Basically, it allows you to not use const in some cases where const should be used. This dates back from the golden era of MFC AFAIK.
Please correct me if I'm wrong.
You are right.
Quote:
I would like to see const added to pick for MSC too on a pure ideological level, but I have no practical consideration that would make me change that.
There is a practical reason why we "exploit" this MSC bug:
Doing so, we are able to catch some pick semantics bugs at compile time. E.g.
void Foo(const Vector<int>& b) {
Vector<int> a;
a = b;
}
does not compile with MSC (which is correct).
(Frankly, I believe that M$ got it right here and standard has it wrong
Note: Thankfully M$ seems to use its own semantics in MFC in some places, therefore they perhaps have to keep this non-compliance to standard.