There are fewer and fewer things that surprise me....
Have you ever worked with C++ compilers that "lighten" C++ standard, allowing some restrictions to be just suggestions?
Nono, I'm not talking about such tiny things like MS compiler allowing variable declared in for() loop to be accessible outside it.
There is something more interesting:
class S{
private: // to be 100% sure
int i;
}
int main()
{
S s;
s.i = 5; // for god's sake, it's just a warning!!! :)
return 0;
}
PS. "... I don't worry about warnings, I worry about errors!"
PPS. Oh, sure, a screenshot would help: http://static.flickr.com/101/314107848_1fad0a3684_o.jpg
Nono, I'm not talking about such tiny things like MS compiler allowing variable declared in for() loop to be accessible outside it.
There is something more interesting:
class S{
private: // to be 100% sure
int i;
}
int main()
{
S s;
s.i = 5; // for god's sake, it's just a warning!!! :)
return 0;
}
PS. "... I don't worry about warnings, I worry about errors!"
PPS. Oh, sure, a screenshot would help: http://static.flickr.com/101/314107848_1fad0a3684_o.jpg
