Herb Sutter's Blog, page 14
December 1, 2014
A quick poll about order of evaluation…
Consider this program fragment:
std::vector v = { 0, 0 };
int i = 0;
v[i++] = i++;
std::cout << v[0] << v[1] << endl;
My question is not what it might print under today’s C++ rules. The third line runs afoul of two different categories of undefined and unspecified behavior.
Rather, my question is what you would like the result to be. Please let me know.
Take Our Poll
Filed under: Uncategorized

November 24, 2014
Updates to my trip report
(this is an echo of what I also just posted on isocpp.org)
I wanted to add a few more things to my meeting trip report. I updated the trip report in-place, but for those who want to see the “diffs” I’ll also post just the new parts here as a standalone post:
There were 106 experts at this meeting, officially representing 7 nations. This meeting saw a recent-record number of papers, including over 120 in the pre-meeting mailing.
In addition to the other things I mentioned, we also approved several other interesting changes, including the following highlights:
Adopted N4230, which allows nested namespace definitions like namespace A::B::C { } as a convenient shorthand for namespace A { namespace B { namespace C { } } }.
Adopted N3922, which fixes the most common pitfall with auto and {}, so that auto x{y}; now deduces the sane and expected thing, namely the type of y. Before this, it deduced initializer_list which was unfortunate and surprising. So, fixed.
Adopted N4086, which removes trigraphs. Yes, we removed something from C++… and something that was inherited from C! But wait, there’s more…
Adopted N4190, and actually removed (not just deprecated) several archaic things from the C++ standard library, including auto_ptr, bind1st/bind2nd, ptr_fun/mem_fun/mem_fun_ref, random_shuffle, and a few more. Those are now all removed from the draft C++17 standard library and will not be part of future portable C++.
We also did work and made progress on a lot of other proposals, including modules. See the pre-meeting mailing for details about papers considered at this meeting.
Filed under: Uncategorized

November 22, 2014
Trip Report: Fall ISO C++ Meeting
I just posted my ISO C++ meeting trip report over on isocpp.org covering our meeting in Urbana-Champaign earlier this month.
The ISO C++ committee is shipping more work sooner via concurrent Technical Specifications, but it’s still fairly new to find ourselves doing so much work that the “new normal” is to issue an international ballot from every ISO C++ meeting. This time, we have four ballots coming out of this meeting — the first (of two) ballots for the Transactional Memory TS, the final ballots for the Library Fundamentals TS and the Parallelism TS, and a new work item for C++17 since this was the first meeting of the C++17 era.
Oh, and we had evening sessions. Did I mention evening sessions? Five nights’ worth.
Now, two weeks later, I’m almost caught up on sleep.
Almost.
But what a blast. I’m looking forward to the next few smaller meetings over the winter, and the next full one in May.
Filed under: Uncategorized

November 12, 2014
VS, Clang, cross-platform, and a short video
Today my team was part of the Visual Studio 2015 Preview announcement, and it’s nice to be able to share that Visual Studio is now going to support targeting Android and soon iOS, using the Clang compiler, from right inside VS. This is in addition to continued conformance and other improvements in our own VC++ compiler for targeting Microsoft platforms.
I recorded an 8-minute video about Visual C++’s conformance improvements in our existing compiler that you can get now in the Preview available today, and why using a single source code base in C++ built using VC++ to target Windows/WP and also Clang/LLVM to target Android and iOS is a hot ticket right now. The Resources slide at the end includes links to two CppCon videos I hope you’ll check out if you haven’t already.
I hope you enjoy the news, and the Preview.
Filed under: Uncategorized

October 18, 2014
My CppCon talks
Also, my CppCon talks are all up on the CppCon YouTube channel. You can find them here:
Back to the Basics! Essentials of Modern C++ Style: Loops, pointers and references, smart pointers, variable declarations, and parameter passing
Lock-Free Programming (or, Juggling Razor Blades), Part 1: Lazy initialization with DCL vs. call_once vs. function local statics, and lock-free mailbox algorithms
Lock-Free Programming (or, Juggling Razor Blades), Part 2: Lock-free linked lists, the ABA problem, and atomic smart pointers
I hope you find them useful.
Filed under: Uncategorized

New Interview
While we were both at CppCon last month and had cameras around, Brian Overland interviewed me for InformIT. The video just went up a couple of days ago. You can find it here.
If you’ve seen my interviews before, the first 14 minutes is stuff you’ve heard before, but I think you’ll find the last five minutes starting at 14:23 to be interesting new material.
Filed under: Uncategorized

September 16, 2014
Next stop: Stuttgart
CppCon was a blast. I can’t wait till next year.
But there’s something coming up sooner than that: In two weeks, Scott and Andrei and I will be holding the C++ and Beyond 2014 “Road Show” in Stuttgart, Germany.
The key to this event is not new material, but a new location. Whereas all other C&B’s have been in North America, this is the first time ever that Scott and Andrei and I are doing an event together in Europe. That’s exciting! (At least for us.) If you’ve been to C&B you will have seen most of this material before, but if you haven’t been able to get to C&B until now you may find it convenient to have the event be more local to European attendees. The talks are all talks we’ve given at C&B before, but there will be updates.
Scott seems to be looking forward to a debate with me about parameter passing. I’m glad he thinks I’m “seeing more reason than [I] used to, (i.e., having moved closer to [Scott's] point of view)” – by which he means that he has moved closer to my point of view. :) Should be fun! The boring truth, as I presented at CppCon on Friday, is that everyone agrees that the default parameter passing rules are the same as C++98… and let the games begin!
Filed under: Uncategorized

September 15, 2014
Trip Report: CppCon 2014
I just posted my CppCon trip report over at isocpp.org.
I’ll repeat just the last part here:
Huge thanks again to the 150+ speakers, planners, and volunteers without whom this wonderful “C++ festival” (as several people spontaneously called it) would not have been possible. I had guardedly high hopes for the event, but I think it exceeded all our expectations. This was the most exciting and enlightening week I’ve experienced in my 20 years of C++, and I’m still catching my breath. I can’t wait until September 2015.
Here are a few pics I and others took. You’ll find more on Twitter tagged #cppcon.
Mark Maimone of NASA and Mars Rover fame.
Bjarne taking questions after his talk.
“We’re sold out of A Tour of C++ again… how about this instead?” [photo credit: Artur Laksberg]
[photo credit: Artur Laksberg]
[photo credit: Artur Laksberg]
Walter Brown speaking in one of the six concurrent breakout sessions.
Jon Kalb speaking in one of the other rooms.
Possibly the youngest attendee? [photo credit: Artur Laksberg]
Accessibility and community.
Yup. Modern C++.
View from the CppCon balcony before diving into more evening sessions.
So long, Meydenbauer Center… see you next year! [photo credit: Hyrum Wright]
Filed under: Uncategorized

August 19, 2014
My CppCon Plenary (updated)
When we announced the CppCon conference program and I posted my final talk selection, the original plan for my Friday ‘endnote’ plenary was for it to focus on giving an update on future standardization plans. However, quite a few people immediately wrote me to express disappointment that I wouldn’t cover my Modern C++ Style material, which they felt was sorely needed as we build updated C++ usage guidance in the presence of everything that’s new in C++11 and C++14 which really do make C++ feel like a new and fresh language. At the same time, I noticed that the standardization material I had planned to cover will be covered very well in the Monday CppCon talk “What the Committee Did Next!” by Alisdair Meredith, chair of the Library Working Group of the C++ standards committee.
So I suggested that maybe we ought to repurpose my Friday plenary session with the other highly-requested topic instead, and the organizers agreed. Here’s the new description:
Back to the Basics! Elements of Modern C++ Style
by Herb Sutter
This talk revisits basic questions, such as how to declare and initialize a variable, how to pass a value to a function, how to write a simple loop, and how to use smart pointers, in the light of experience with C++11 and the latest C++14 refinements. This involves examining auto, rvalue references, range-for loops, uniform initialization, lambda expressions, unique_ptr and shared_ptr, and more.
Like all CppCon sessions, this talk will be recorded and is expected to be available online a month or two after the conference.
Note: If you’re in the Seattle area, note that Friday admission is free and open to all, as are evening and breakfast sessions, even if you don’t have a registration to see the other 100+ daytime technical sessions. (Though if you’re in the Seattle area and a C++ developer, why wouldn’t you register for the whole conference? Airfare and hotel are the majority of the total cost for most attendees, so if you’re local anyway this is some of the most inexpensive high-quality training there is. Just sayin’. Note that I am one of the CppCon organizers but I have no personal financial stake in CppCon – I’m not getting a penny from it – I’m just a delighted participant and attendee.)
I’m looking forward to seeing many of you at CppCon!
Filed under: C++

July 3, 2014
Trip report: Summer ISO C++ meeting
I just posted my isocpp.org trip report from the recently concluded ISO C++ meeting in Switzerland.
We sent three documents out for ballot. This is the first time in ISO C++ history that we have sent three documents out for ballot out of a single meeting. Wow.
See the full trip report for more details…
Filed under: C++

Herb Sutter's Blog
- Herb Sutter's profile
- 32 followers
