Visual C++ and C++ Standard
Screaming Lunatic writes: "There is an interview over at codeproject about the future of C++ and .NET. Since I don't really care about .NET, the interesting part of the article is about the quest to standarize Visual C++. If you're going to code for Windows, Visual C++ is one of your few choices for a IDE/compiler combo. (Even though, if I'm not mistaken, you can hook gcc up to the IDE.) M$ seems somewhat in favor of conforming to the C++ standard, which is surprising. They talk about pushing forward with template compliance. I'm still waiting for them to get the variable declarations in for-loops right. They also claim to beat several popular compilers in compliance tests."
I'm still waiting for them to get the variable declarations in for-loops right.
/Za, then they already do.
If you compile with the 'disable extensions' flag,
Even with extensions enabled, VC++ 7 will warn when there's a conflict between extended and correct behaviours:
forvar.cpp(4) : warning C4288: nonstandard extension used : 'i' : loop control variable declared in the for-loop is used outside the for-loop scope; it conflicts with the declaration in the outer scope
I've dug through MSDN a while back and found this to work..
//Work around for broken for-scoping in VC++ 6
#pragma warning(disable:4127)
> For me the big killer is templates -- lots of failures in things like partial specialization.
Yeah, the lack of C++ conformance in MS VC is a real pita.
However, Modern C++ Design: Generic Programming and Design Patterns Applied by Andrei Alexandrescu has a clever sizeof() hack to work around this in VC6.
Modern C++ Design is the most advanced C++ book out there, and EVERY C++ programmer should have this masterpiece. The perfect blend of generic programming and object orientation programming is just beautiful. (The multiparadigm support of C++ is what makes it so powerfull.)