Trip Report, October 2002

This month, an update on the most recent C++ Standards meeting, and why things are (finally) heating up.


February 01, 2003
URL:http://drdobbs.com/trip-report-october-2002/184403857

February 2003/The New C++



Copyright © 2002 Herb Sutter

I'm going to spend this column reporting on happenings at and around the most recent C++ Standards meeting, because things are now heating up, at least a little. In particular, the first two proposals for C++ Standard library extensions have now been accepted by the committee — and it's something of a breakthrough, in that this represents the first new work to be accepted since the first round of standardization was completed in 1997!

First, a Word from Our Technical Corrigendum

Since 1998, the C++ Standards committee has spent most of its time processing queries and potential minor bug fixes to the existing Standard. In my writing, I've sometimes referred to a few of the more notable bug fixes; for example, in Item 7 of More Exceptional C++ [1], I mentioned that we were adding the requirement that a std::vector's internal storage be contiguous, so that a programmer can take a pointer to some element inside a vector and safely do pointer arithmetic to traverse the vector's contained elements just like an array. I've also mentioned that the first batch of these are being published as Technical Corrigendum 1 (a.k.a. "TC1"; think of it as "service pack 1") to the C++ Standard.

Some astute readers, including Daniel Spangenberg, have asked why they can't seem to find an official copy of this much-vaunted TC1. I blush — the unfortunate truth is that sometimes ISO wheels grind exceedingly slowly. Although the first batch of corrections was approved by the committee back in October of 2000 (yes, really two years ago), it took another couple of meetings before the final text could be prepared and carefully proofread, and the TC document only just went out for ISO balloting in November 2002 and that final international voting will conclude in mid-February of 2003. We don't expect any surprises; if so, then the TC will be official around the time you read this.

In the meantime, I'd like to remind everyone of some long-standing good news: you don't have to wait for ISO to issue new documents to stay up to date on the committee's work (and you can be sure that your compiler vendor doesn't wait that long). You can always get an up-to-date list of all issues and their status right from the ISO C++ committee's website at <http://std.dkuug.dk/jtc1/sc22/wg21/>. Again, that's "all" issues, not just the ones resolved in TC1.

If and when you do peruse the issues via the ISO C++ website, be sure to check both the Core and Library issues lists, because language and library issues are tracked separately. There are three major categories of issues:

News from the Front

Here's a quick update on the C++ committee's goings-on at the most recent meeting. For a more complete backgrounder on the current C++ Standards process, published exactly a year ago and still pretty current, see [2], which is my initial "The New C++" column.

The C++ Standards committee (ISO WG21, ANSI J16) met in Santa Cruz from October 20-25, 2002. The C++ committee is currently busy with the following major pieces of work:

Issues and Defect Reports (DRs). The committee continues to spend about half its time answering queries about the existing Standard, issuing clarifications, and fixing bugs (including typos and small inconsistencies). There have been several new fixes approved since TC1 was finalized; it remains to be seen whether there will be a second interim Technical Corrigendum, or whether the updates will just be rolled straight into the next major revision of the Standard, C++0x.

Evolution Working Group (EWG). The C++ Evolution Working Group is now actively considering extensions for the next full revision of the C++ Standard. The EWG is normally chaired by Bjarne Stroustrup, but as he couldn't attend this meeting I chaired it in his absence. (I think Bjarne has only missed about four meetings in the decade-plus history of C++ standardization; it doesn't happen often, and he continues to be very active in C++ Standards work.) What kinds of things does the EWG consider? Well, library-related issues, such as new containers and things like tuples, are already being considered as part of the Library TR noted below. But the Library TR cannot consider extensions to the core C++ language itself, and this is where the EWG comes in as the first filter to consider new proposals to extend the C++ language.

The Evolution group's goal at this meeting was to consider the initial batch of concrete proposals, and to offer the authors guidance on which ones we were interested in and how to refine them. We considered about a dozen proposals, ranging from my typedef templates paper to Bjarne Stroustrup's typeof proposal, from compile-time assertions to move constructors, and the authors have the feedback they need to go back and refine their proposals for further consideration at the next meeting. (I think the next meeting promises to be interesting — just as we had the very first new library extensions since 1997 approved at this meeting (see below), we might just get the very first new language extensions since 1997 approved at the next meeting in April 2003. Time will tell; watch this space for updates.)

Library Technical Report (TR). Well, we're actually working on two Technical Reports, but the Library TR in particular is the most noteworthy one because it's definitely intended for direct inclusion the next C++ Standard, a.k.a. C++0x [3]. While the Evolution WG concentrates on refinements to the core language, the Library TR is all about adding new functionality to the standard library; the original intent was to get a head start on the next round of standardization, which is expected to include aggressive additions to the standard library.

If the Evolution WG is now reviewing proposals, why continue with a separate Library TR? Because people hope the Library TR can be finalized sooner (say, perhaps in two years) than we could finalize a review-ready draft of the whole next C++0x Standard.

At this meeting, the big Library TR news was that the first two library extensions were approved for the Library TR! In brief, they are:

That's why I say that things are heating up, at least a little — after several years of maintenance-only mode and about a year of talking about extensions, these are finally the first two extensions to the C++ Standard library to be actually accepted by the committee since the first standard was finalized in 1997. They are certainly a harbinger of many more to come, as we considered well over a dozen library and language extension proposals at this meeting.

Are you wondering what these two new extensions are all about? If so, then keep reading this column — in the next two installments, I'll cover each of these two accepted library extensions in detail. Then I'll be writing the column after that just in time to report on the next C++ meeting, to be held in Oxford in early April of 2003, where it's likely that the first new C++ language (not just library!) extensions will be presented for vote by the committee. Stay tuned.

References

[1] H. Sutter. More Exceptional C++ (Addison-Wesley, 2002).

[2] H. Sutter. "The New C++," C/C++ Users Journal, February 2002.

[3] The other one is the Performance TR, which is focused primarily on hardware issues, embedded systems work, and C++ implementability (e.g., how to implement and use exceptions for best performance). The Performance TR is currently in balloting and should be published in early 2003.

[4] D. Gregor. "A Proposal to Add a Polymorphic Function Object Wrapper to the Standard Library," ISO/ANSI C++ standards committee paper (ISO/IEC JTC1/SC22/WG21 paper N1402, ANSI/NCITS J16 paper 02-0060).

[5] J. Järvi. "Proposal for Adding Tuple Types into the Standard Library," ISO/ANSI C++ standards committee paper (ISO/IEC JTC1/SC22/WG21 paper N1403, ANSI/NCITS J16 paper 02-0061).

Herb Sutter (<www.gotw.ca>) is convener of the ISO C++ standards committee, author of the acclaimed books Exceptional C++ and More Exceptional C++, and one of the instructors of The C++ Seminar (<www.gotw.ca/cpp_seminar>). In addition to his independent writing and consulting, he is also C++ community liaison for Microsoft.

Terms of Service | Privacy Statement | Copyright © 2024 UBM Tech, All rights reserved.