Slashdot Mirror


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."

4 of 31 comments (clear)

  1. STILL no export templates? by Mik!tAAt · · Score: 4, Insightful

    Microsoft's goal is to have a 'competitively compliant' compiler - meaning it won't be 100% compliant. There are a couple of features of the ANSI/ISO standard (for instance the 'export' keyword as applied to template classes) that won't be implemented because they are considered by Microsoft to be obscure and, at this stage, theoretical.

    Somebody please explain to me why would somebody consider export templates to be 'obscure' and 'theoretical'? If export templates aren't available, you have to put most of your code in header files (or at least use your .cpp files as header files), and that IMHO is just plain stupid.

    On the other hand, aiming for STL, Boost, Blitz and Loki compliance is a Really Good Thing.

    --
    This is the place where you write something that will make you seem like a complete idiot.
  2. for loop fix by cfreeze · · Score: 3, Informative

    I've dug through MSDN a while back and found this to work..

    #pragma warning(disable:4127) //Work around for broken for-scoping in VC++ 6

  3. templates, for-loop-scoping, etc by devphil · · Score: 4, Interesting


    Microsoft is definitely full of shit when they consider 'export' to be "theoretical" only. But implementing export is hard; witness the number of compilers that have managed to do it so far. I don't blame MS for putting it off; I blame MS for lying about their reasons for doing so. (If they'd just said, "Implementing this is a freakload of work and we'd rather point our engineers in a more revenue-profitable direction," then I could accept that, too.)

    The for-loop scoping bug has a command-line switch to toggle correct behavior. Unfortunately, with it on, large chunks of their own MFC code will no longer compile.

    Dinkumware was contracted to provide the library for VC++. They have released their own patches (freely downloadable) to the library headers. With those patches applied, your library is as ISO-compliant as it can be given the (immense) deficiencies of the compiler itself.

    For me the big killer is templates -- lots of failures in things like partial specialization.

    My recommendation to others who have to work under Wintel: there are plenty of good compilers out there, and they're ALL better than VC++. Comeau, IBM, EDG, KAI, you name it...

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
    1. Re:templates, for-loop-scoping, etc by UnknownSoldier · · Score: 4, Informative

      > 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.)