CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Dec 2008
    Posts
    21

    VS2010 and C++0x

    Hello

    My name is Damien Watkins and I am a Program Manager* (PM) on the Visual C++ team – specifically I am fortunate enough to work in the Language and Libraries areas. Joining me on this slow chat will be many members of the VC++ team, however in particular I would like to introduce Jonathan Caves and Stephan T. Lavavej, the reasons why will become clear as we progress. As many of you are aware, we are currently in the Visual Studio 2010 (VS2010) Product Cycle and at the PDC in LA (http://www.microsoftpdc.com/) we released a VS2010 Community Technology Preview (CTP - http://blogs.msdn.com/vcblog/archive...-released.aspx). With this slow chat I would like to cover the C++0x work we have completed so far for VS 2010 (although questions on other topics are most welcome too.) So what is C++0x?

    C++0x (http://www.open-std.org/jtc1/sc22/wg...2008/n2798.pdf) is the next version of the C++ Standard, this contains both language and library enhancements over the current standard. Currently C++0x is at a “Committee Draft” stage (you can think of this as being similar to Beta 1 in MS speak) and is now in a public review period [as an aside, if you wish to provide feedback on the C++0x draft please contact your national representative]. In this initial posting I will not be covering in detail any of the C++0x Libraries enhancements, commonly known as Technical Report 1 (TR1). We have already released our implementation of TR1 and you can download this as part of the Service Pack 1 for Visual Studio 2008 (http://msdn.microsoft.com/en-us/vstu.../cc533447.aspx). If you want to know about all the goodies contained in our implementation of TR1 then you can read these posts by Stephan on the VC Blog: (this is where Stephan enters the story, STL is our STL expert – with initials like that what else would he be?):

    • Q&A on our TR1 implementation (http://blogs.msdn.com/vcblog/archive...mentation.aspx)
    • TR1 Slide Decks (http://blogs.msdn.com/vcblog/archive...ide-decks.aspx)

    Stephan also did a Channel 9 Video on TR1 too (http://channel9.msdn.com/shows/Going...-Report-1-TR1/).

    Now here is where Jonathan enters the picture, apart from being one of our developers, he is also the VC++ representative on the C++0x committee. I know many of you will also know that until recently Herb Sutter was the committee’s convener (and as such was not a VC++ representative per se - he did not represent the VC++ team but worked for the C++ community in general) and Herb is an architect on the VC++ team.

    Now during the VS2010 planning stage, C++0x was still in a state of flux and this presented an issue to us. Of course we wanted to be highly conformant to the new standard and many of the new C++0x features looked like very valuable additions for our customers. However, without the standard being finalized, potentially until after we ship, and with finite time and resources on our team, we need to target a coherent subset of C++0x features that were relatively stable for inclusion in VS2010 (seems Standards Work seems to take even longer then Product work, believe it or not). So where did we end up – let us look at some of the features that are already available in the aforementioned CTP:

    • auto, or rather the repurposing of this existing keyword to provide a form of type inference
    • lambdas (personally my favorite C++0x feature)
    • rvalue references
    • static_assert

    Now for a very simple introduction I will put a trivial example of the usage of each of these below (all borrowed from STL’s VC Blog post). However if you want detailed descriptions of their semantics and/or their workings in VS2010 then you should read the excellent posts that Stephan did on the VC Blog - Part 1 (http://blogs.msdn.com/vcblog/archive...10-part-1.aspx) and there will be an upcoming Part 2):

    auto
    Code:
        for (auto i = m.begin(); i != m.end(); ++i) 
            { cout << i->second << " are " << i->first << endl;    }
    Lambda
    Code:
        transform(v.begin(), v.end(), front_inserter(d), [](int n) { return n * n * n; });
    rvalue references
    Code:
        void meow(const X&) { cout << "meow(const X&): Copying." << endl;}
        void meow(X&&) { cout << "meow(X&&): Moving." << endl;}
    static_assert
    Code:
        template <int N> struct Kitten { 
         static_assert(N < 2, "Kitten<N> requires N < 2.");};
    Combinations

    And you can also generate some interesting synergy when using them in combination too:
    Code:
        auto notpred = [&](const T& t) { return !pred(t); };
    Again, please see Stephan’s posts if you want more details or complete examples. I also wanted to mention that Kate Gregory (one of our MVPs and great friend of the VC++ Team) did a TechEd Developer Europe talk (http://www.microsoft.com/emea/teched...lt.aspx?vid=63 - you may have to scroll backwards to find it in the list of videos) on some of our C++0x features too.

    Since C++0x was still baking when we did VS2010 planning this meant that a few very important but very large or incomplete features will probably not make it into VS2010. Personally my deepest regret is that Variadic Templates will not make VS2010. From the community we also often hear that Concepts is another widely anticipated feature, but this too will miss the cut for VS2010.

    Now I should mention at C++0x work is not the only work we are doing for VS2010. If you are interested in our:

    • Design Time Experience (for which we often use the term “10 is the new 6”), then you can watch Boris’ PDC talk (http://channel9.msdn.com/pdc2008/TL13/)
    • Project and Build System, you can read Marian’s VC Blog (http://blogs.msdn.com/vcblog/archive...msbuild-n.aspx)
    • MFC, then you can watch my PDC talk (http://channel9.msdn.com/pdc2008/pc26/)

    Now VS2010 is not finished yet, so more is still coming, so I hope you will look out for any CTPs/Betas that we release before VS2010 ships and give us feedback as soon as you can. One of the best places for this, apart from this week’s slow chat of course, is the VC Blog (http://blogs.msdn.com/vcblog/). Many of us read this as often as we can and even if we cannot reply to everyone we use this feedback whenever we can to inform our planning process.

    Thanks for reading this post and please let us know what you think; we look forward to reading your comments
    Damien
    --
    * During a review of this post I was asked to add an explanation of what a PM does. As you may know, in the VC++ model, features are normally implemented by a Feature Crew; these consist of some number of developers, testers and PMs. Now it is kind of obvious what developers and testers would do, you can think of PMs as doing many of the other things; customer liaison, specifications, scheduling, cross group collaboration and presentations. Now circumstances can see variation of just exactly who does what but this is enough of ballpark description to give you the correct idea.
    Last edited by Brad Jones; December 4th, 2008 at 11:20 PM. Reason: Added Code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured