C++ and Beyond: My material for December, and early-bird registration (through June 9)

If you’re thinking of coming to C++ and Beyond this December, consider registering in the next two weeks to get the $300 discount.

I’ve just announced that much (and possibly all) of my material will be in heavily interactive sessions about modern C++11/C++14 style and idioms, covering the “complete C++11 package” that we’re calling C++14. We know C++14’s shape because as of the Bristol meeting in April it’s now feature-complete, and only international commenting and other fine-tuning remains. We know C++14 is real and that at least two of the major commercial compilers will be implementing all of C++14 by next year. And we know C++14 really does complete C++11, and it’s compelling enough that it’s made me rewrite my Guru of the Week series and Exceptional C++ books, targeting C++14. From the description:

This session will cover modern and current C++ style, focusing on C++14. I’ll demonstrate how major features and idioms from C++98 are now entirely replaced or subsumed and should be used no more; how other major features and idioms have been dramatically improved to the point where you code is cleaner and safer and you’ll even think in a different style; and how pervasive styles as common as variable declarations are changed forever, and not just for style but for serious technical safety and efficiency benefits. For one thing, you’ll never look at ‘auto’ the same way again (there, I said it; bring out the lederhosen and pitchforks! or attend the session and challenge in person to dig deep into the good reasons for the new reality).

Scott has announced one of his prospective talks: “Concurrent Data Structures and Standard C++.” From his description:

Concurrent data structures permit multiple writers to simultaneously modify a single data structure. Used properly, they can avoid scalability bottlenecks in multithreaded systems. Used improperly, they can decrease program performance.

There are no concurrent data structures in the C++98 standard library. The C++11 standard library is similarly bare, and C++14 is unlikely to change that.  Nevertheless, concurrent data structures for C++ developers are widely available from sources such as Microsoft’s PPL, Intel’s TBB, and Boost. In this talk, I’ll examine the motivation and use cases for concurrent data structures, discuss their limitations, survey offerings common to PPL and TBB, and contrast concurrent APIs with those of seemingly similar serial counterparts (e.g., concurrent_vector vs. std::vector). I’ll also explain why writing your own concurrent data structure is much more complicated and error-prone than most people initially imagine.  (If you’re not familiar with the ABA problem, this presentation will explain why you should be.)

For more information, see the C&B blog. I look forward to meeting and re-meeting many of you at C&B. The attendance is limited to 64 this year, and it will be a delightful technical C++-fest in a cozy lodge far from distractions and with lots of fireplaces.

23 thoughts on “C++ and Beyond: My material for December, and early-bird registration (through June 9)

  1. @Alex: Thanks, I was just double-checking that talk again too. Indeed, we did miss a promise that was on the slide which was to deliver “more batches” in the first half of 2013, and I should speak to that in my Build talk this month. At that time, we said that because we had intended to produce another CTP in spring. Two things happened: When turning the crank in about a year on VS 2013 became a reality we had to focus on that release vehicle to make sure the features for it were up to release quality (bug bar, Intellisense support, static analysis support, libraries support, and such). Also, it took us longer than expected to stabilize variadic templates, because for us part of doing C++11 is that we need to rewrite parts of our compiler that are up to 30 years old — for example, unlike GCC and Clang, our compiler has never had an AST, and you kinda sorta need that for some C++11 features — and in retrospect variadic templates would have consumed much less effort if we’d done it after waiting for a little more of the AST-related rework instead of doing it in the existing codebase which caused more complexity and a longer bug tail. Although we missed on our intent to deliver another CTP in the spring for those two main reasons, we’re following through on the spirit of what we promised which is applying more resources to implement and test C++11 features, do ongoing rejuvenation of our compiler codebase to better support C++11, and release more CTP and RTM builds containing more conformance features on a faster-than-every-2-3-year cadence, and I’ll have more news to share on those at Build. We got beaten on this expectation by being a little more transparent than a company this size normally is, but I think erring on the side of transparency is still the right place to be and we’ll keep doing that, but hopefully better by letting customers know earlier if we can’t meet a deadline, and by being more explicit about how we want to show progress — such as addressing expectations about when features will appear (because we didn’t say otherwise, many assumed they’d be in an Update, so we need to communicate better).

    Re versions and upgrades: Note that part of the confusion is that we’re kind of “shifting worlds” with the way and frequency we deliver Visual Studio, so there’s a transition period for us and for customers to learn and get used to the new model and cycle. Instead of shipping a big lump every 2-3 years with a sort-of-annual service pack as we’ve done for a long time, we’re moving to a cadence of smaller more regular releases plus Updates in between. VS2013 is the first of those regular releases, so it shouldn’t be viewed the same as the VS2012 which was the last of the old-style big-lump releases for example, even though I realize its naming initially makes it sound like that until we learn and get used to the new pattern. Details of the future VS release roadmap and upgrade policy and such will be announced when and as the VS folks have them available; I can speak directly for the VC++ part of the product, and then how that gets shipped in an actual release depends on the cadence of the larger VS product.

    Thanks for your support of our product, and I hope that the news at Build and onward will be satisfying and helpful.

  2. @Herb,
    2) I believe that the exact statement was:
    As for Microsoft’s product specifically, we’ve said we’re planning to ship out-of-band releases “soon after VC++ 2012″ (which is soon indeed now!) and particularly that we want to take advantage of that capability first to deliver more and more batches of C++11 features, first in a CTP (community tech preview) or similar form.
    Saying “first” implies a “second”.

    4) OK, let’s set the “free” issue aside then. I may have been inferring too much.
    Can we expect an update (either free or paid) that will bring C++11 (or C++14) compatibility to VS2012?

    Best regards,

  3. @Alex: 2) Well, I did say “a CTP or an RTM.” 4) Sorry, I didn’t mean to be confusing and I didn’t think I ever said free updates — can you point to the post? I’d like to fix it. Thanks!

  4. @Herb,

    1) I was not moving the goalposts, the issue was and continues to be C++11 conformance. However, since the C++11 changes are minor, it may (wild guess) be easier for your team to ignore C++11 and do C++14 instead. I did not mean to imply that anything like that was promised but decided to ask about it just in case.

    2) A CTP that comes without a go-live license is hardly a case of “and we’ve done that”.

    3) Visual Studio is a bundle of features and a lot of people do not need all the new ones in VS2013 but just want a conforming compiler. To make a car analogy, I wouldn’t buy a new car just because I want satellite radio.

    4) Your reply is confusing. You did talk about a shorted time frame to conformance and you also talked about free updates (in the same post, if I remember correctly) so was natural for people to connect those two together. With all due respect, but if it was not what you meant, then not saying it outright and leading us to believe the opposite was disingenuous.

  5. @Alex: Brian’s announcement was only of a subset of features in VS2013. Much more, including C++ updates, will be announced at Build in three weeks.

    The Express SKU is free, and always includes our latest C++ optimizing compiler with all the features we have implemented. VS subscription customers get updates for free for the life of their subscription, I think. Beyond that I’m not sure of other details, but the upgrade policy VCS 2013 will be announced and should be able to answer any other questions.

    I tried very hard to be crisp and not imply anything beyond what we actually knew explicitly — but FWIW I notice even your question morphed from “free C++11” at the start to became “free C++14” by the end. Please no adding goalposts to what I actually said, or moving the goalposts even in the same question. :) I can summarize what we announced, and you can check the posted talk slides: At GoingNative Feb 2012, we announced that you shouldn’t expect to have to wait the usual 2-3 years between VS releases to get more C++11, that we would do more out-of-band releases (CTPs and/or RTMs) on a faster cadence, including but not limited to using them to deliver conformance features, and we’ve done that. And at Build in Nov 2012 we announced the Nov 2012 VC++ Compiler CTP and its new features, and promised that we’d share more information in the first half of 2013, and we’ll do that this month at Build.

    Some customers hoped/inferred that the CTP features would land in an Update; then after a while said that they would ship in an Update; and then most recently claimed that I had in fact announced they would ship in an Update. I actually didn’t say that, specifically because we didn’t know if we could get them into an Update and we didn’t want to promise something we maybe couldn’t do. But I’ll keep saying what we know when we know it and are sure, and will try to continue improving in communicating more clearly and your and everyone’s feedback on that is always appreciated.

  6. @Herb, thank you for your reply, but there is a bit of a difference between snarky remarks and delivered features.

    I am very concerned about the standard support in VS2012 because I invested a lot of efforts to persuade my company to purchase VS2012 (for more than 50 developers), based on my interpretation of your promise — that VS2012 will get full C++11 compatibility via free updates (and I am sure that I was not the only person to interpret it this way).

    Now, I see Brian Harry announcing VS2013 (http://blogs.msdn.com/b/bharry/archive/2013/06/03/visual-studio-2013.aspx) and, given my previous experience with MS, I suspect that you (plural) will prefer pushing users to buy the new version rather than putting out free upgrades to the older one. Profits always trump “the right thing to do”.

    Should this happen, I am fairly convinced that the following will happen:
    1. My credibility within the company will be shot (best case scenario).
    2. We will start transitioning to a free compiler (likely GCC or CLang) and eventually away from Windows and other MS products (the main reason that the developers are on Windows 7 is to run Visual Studio).

    I have no intention of “scissors headlocking” you or anything but I do believe that you have the moral obligation to answer the following:
    1. Will there be a free upgrade to VS2012 to provide full C++14 compatibility (in whatever time-frame)?
    2. If not, will there be a free upgrade to VS2012 to provide full C++11 compatibility (in whatever time-frame)?
    3. If not, what level of compatibility should we expect?

    Best regards,

  7. @S. Colcord: Isn’t there a glaring omission from that libstdc++ C++11 conformance list? In particular, as of gcc 4.8 when I looked earlier this month, I believe their basic_string uses copy-on-write (COW). This has long been a bad idea in concurrent code for performance and correctness reasons (see my 1999 CUJ article http://www.gotw.ca/publications/optimizations.htm) and now is nonconforming in C++11 (breaks conforming user code). To conform to C++11, libstdc++ basic_string needs essentially a ground-up reimplementation, though they can probably salvage the code in most of the helper functions that should have been nonmembers in the standard — see GotW #84 at http://www.gotw.ca/gotw/084.htm.

    And BTW as I recently mentioned again in the recently revised GotW #2 at https://herbsutter.com/2013/05/13/gotw-2-solution-temporary-objects/, the libstdc++ maintainers should run, not walk, to add glorious SSO when they rip out odious COW. Not that I have any strong opinions on this or anything.

  8. @Alex: Naturally, and I called my team out in my “GotW and Exceptional C++” post: https://herbsutter.com/2013/05/04/guru-of-the-week-and-the-exceptional-c-series/ (see the “preemptive snarky remark”). :)

    At the time we announced the November 2012 CTP, what we promised was to communicate further news in the first half of 2013, so we’re on the hook to say something no later than June 30. If July 1 dawns without that promise fulfilled, you can be approximately the 1000th person in line to slam me down on the mat and apply a scissors headlock while the 1001st person jumps down from the top rope to deliver a sledgehammer. Or something. I’m not very good with fake-wrestling analogies.

  9. @JC_Yang: Unfortunately, GNU is some distance from having a fully conforming standard library implementation (). This is ironically just the opposite of Visual C++, where the compiler is lacking, but the library is complete (to the extent it can be given the compiler).

  10. Yes, MSVC2012 not supporting C++11 is really a pain in the ass. Now I am sitting here with MinGW and a Clang-Head checkout. Fine so far, but unfortunately it makes debugging the code a bit cumbersome, almost impossible. I can only hope that CodeLite or something similar can get things running. But that MSVC is so far behind is really embarassing. Why do you not just trash your compiler and integrate Clang into MSVC. That would be a lot better, and Clang officially needs Microsoft Extension support, so you could focus on that one… Kinda stupid to develop your own compiler these days. Clang is just perfect, no need for anything else…

  11. I apologize for bringing the subject up, but somebody has to point to the elephant in the room: MSVC++11

    When people complained about how little MSVC++11 brought to the table (in terms of C++11 standard compliance over MSVC++10), MS promised to address the issue by releasing free compiler updates.

    So far, no such updates were made available (and, no, the November CTP – from half a year ago – does not count, since it does not come with a “go live” license).

    So unless one of the “major commercial compilers” is such a free update to MSVC++11, you will have some explaining to do.

  12. @Brian M: C++11 is quite here, out of the four I just mentioned, only one has major black spots. (Herb, please start whipping around the appropriate office! :) )

  13. “We know C++14 is real and that at least two of the major commercial compilers will be implementing all of C++14 by next year.”

    Define “major commercial” :) There are 4 major C++ compilers: CLang, GCC, Intel Composer XE and MSVC. If I cross out the open source ones…

  14. Any change to a standard only becomes usable when its fully supported, otherwise it’s not a ‘real’ standard, just wishfull thinking! Adding another change before 11 meets a ‘real’ standard level of adoption is just plumb silly! Makes one wonder if some of the HTML5 standards people have migrated to c++ :)

  15. @herb
    C++14 will be implemented that fast because there is much less to implement. :) Excuse my selfishness but I would be happy if poor compiler devs :) had years of work for C++14 (ofc if it was to implement nice features, not broken stuff).
    But again this is totally off-topic, my advice was just to tone down the C++14 while advertising because IMO ppl will take you more seriously. C++11 IMO still hasnt been “mapped out” totally so Im sure there is plenty of C++11 topics ppl would like even if you never mentioned C++14

  16. @nosenseetal: In addition to the other comments, you should view it not just as “what’s in a published standard” but “what’s commercially available and real.” In that sense, C++11 (standard date) is “C++13” in “real availability” since compilers are still catching up to C++11 and we hope that the first fully conforming C++11 implementation will be available sometime this year — Clang just became C+11 code-complete last month but that’s checking in code not testing and shipping, and GCC is close but also not shipping a fully conforming implementation yet. OTOH, we do expect to have one and possibly multiple fully conforming C++14 implementations at approximately the same time as C++14 itself is published. So you can view this as the standard and commercial reality syncing up.

    After C++98 was published, it was five years before the first fully conforming shipping commercial implementation.

    After C++11 shipped, it looks like it might be just two years before the first fully conforming shipping commercial implementation: Clang might release again just before the end of the year at their current cadence and if so should be largely conforming. But that’s probably the only one; GCC already did their normal annual spring release, and unless something changes they won’t be shipping a full implementation until next year’s spring release at earliest.

    When C++14 ships, however, it looks like we’ll have at least one and possibly multiple conforming commercial implementations available roughly simultaneously, the same year.

  17. @Michael: Yes, C&B attendees get PDF and printed handouts (you can opt out of the latter to save trees), for your own use and within your organization.

  18. @Nicol
    return type deduction for me looks like a small thing. :) Maybe it will look more important to me when I get exp.
    polymorphic lambdas – nice , but I really wish committee made lambdas shorter to write, maybe by making _, _1 _2 _3 … “contextual keywords” inside lambda so squaring of range could be done with
    std::transform…, []{return _*_; }); and more complicated stuff that takes more than 1 param could be done with
    sort(, [](){return _1.total_msec() < _2.total_msec();} );

    Also idk if it would be possible to have return keyword also optional, or it would be impossible to deduce if programmer meant void function that does something or nonvoid function that returns something.
    And about C++14 being announced as a bug fix release – that doesnt make it less disappointing, just less surprising. I mean 3 y for few items.
    But then again this is not something personal against Herb, for eg it makes me happy that he keeps the renaissance going by updating GotW… I really appreciate that. :)

  19. As part of C++14 style it would be really cool if you could take some examples and tutorials for popular C++ libraries and update them to C++14 style.

    For example: in boost::asio there is a nice C++98 style usage example: http://www.boost.org/doc/libs/1_53_0/doc/html/boost_asio/example/echo/async_tcp_echo_server.cpp that can (hopefully) be converted to C++14 style. There are several handlers for connection and they pass dumb pointer to session data between them. Handlers can use lambdas instead of bind. Thanks to capture by move in lambdas dumb pointer can be replaced by lambda that captures unique_ptr. And sure there is much more to it.

    I think there is some extra value in applying new style to practical old code examples rather than abstract examples.

    Do conference participants receive training materials? If so under what conditions?

  20. > think you might want to tone it down because most ppl who know anything about C++ know C++14 is really really small improvement over C++11, so they might consider it pure PR.

    … Huh? Return type deduction is “really really small”? Generic lambdas are “really really small”? Relaxed constexpr functions is “really really small”?

    Were the changes few in number? Yes. Does that make them *small*? Absolutely not. These will fundamentally change how you code, much like `auto` and range-based for changed how you coded with C++11. These “quality of life” issues are important; they affect the lives of programmers on a daily basis.

    Could more have been done? Absolutely. But in terms of having an effect on programmers and the language, these changes will unquestionably change how you write your code.

    C++14 was never advertised as being something large. It was *always* stated to be more of a bugfix release, so it’s not like the committee over-promised (though the lack of a fix for uniform initialization is still highly annoying). So if you feel that it’s not big enough, that’s more your expectations than what was said to be in it.

    > but for those who disagree you might wanna read this:

    Maybe *you* should read the part where he said, “The meeting was 6 days long, but I was only able to attend for the first 2 days. Unsurprisingly, I spent my time in the Concurrency group (SG1).” In short, he *only* saw concurrency stuff.

    The committee didn’t just add one concurrency paper; that’s just *all he saw*.

  21. Scott’s content looks cool, your description sounds vague but as usual you are a good lecturer so I guess youll do a great job.
    Also all this C++14 stuff – think you might want to tone it down because most ppl who know anything about C++ know C++14 is really really small improvement over C++11, so they might consider it pure PR. And some evil ppl like me:P may just get reminded how much they hate that committee did so amazingly little in 3y. I know Im gonna get downvoted but for those who disagree you might wanna read this: http://www.justsoftwaresolutions.co.uk/news/accu-2013-and-c++-standards-meeting.html
    “The paper that did get approved ”
    note value of nPapers in this. :)

Comments are closed.