N2051=06-0121 Evolution of the C++ Standard Library
This paper is intended to raise the visibilty of the direction for
the library portion of the next C++ Standard. Currently the Library
Working Group are working hard to deliver what we believe will be the
best possible library for the new standard. Meanwhile, Evolution and
Core are largely trusting that the right library will emerge. Now that
the Evolution/Core direction is solidifying, it is a good time to
check everyone is heading to the same destination!
Outstanding work for C++0x:
The work that is already in progress includes -
* Incorporate Library TR1 into main standard
* Review enlarged library for appropriate use of rvalue references
* Review enlarged library for application of concepts
* Review enlarged library for new memory model / concurrency guarantees
And depending on other features coming out of core / evolution
* Review enlarged library for application of contracts
* Review enlarged library for module support
In addition there are a couple of smaller projects
* Deprecate and replace std::auto_ptr with something easier to use
* Deprecate and replace std::vector<boo> with something less confusing
Some of this work is already done, some is ongoing.
TR1 minus the special math functions was voting into the working paper
at the Berlin meeting.
The random numbers portion is already undergoing a significant revision.
The rvalue references work is largely done, pending the Core Working
Group signing off on the language feature.
There is some early work on the impact of incorporating concepts, and
how they might change we way we write standards clauses, replacing many
tables. However, this is not yet a mature work, as the language feature
itself is still evolving and it will take a while for widespread
understanding of the syntax and how to specify it.
Likewise, the aims and direction of the memory model are understood but
it will still take time to review the library portion of the standard to
make sure that while we say as little as possible about this, we still
say enough. Writing a few words may prove hard than writing a lot...
We have a candidate replacement for auto_ptr, and a candidate for the
vector< bool > replacement should be in this same mailing, but is still
a first cut.
In addition to working on the next standard, there is a parallel project
to produce library TR2. It is not yet clear what the delivery dates of
either the next standard or TR2 will be, nor which will emerge first -
although a best guess might be that TR2 follows around 12 months after
the next standard.
The LWG are working on the principle that all significant library
additions (when not motivated by a core language change) should be
published through a TR process before being considered for inclusion
in the main standard.
Strong candidates for TR2 include:
* Filesystem (accepted)
* Thread support
* Date and time
* Network file support
* Consistent system/OS error reporting
* Range-types, to complement iterators
* String algorithms
* Optional/Nullable values
* Range-checked numeric-casts
* 'Lexical' casts
* typesafe 'any' class
* interval arithmetic
* Unlimitted precision integer type
Point of interest:
During the evolution of the next standard, there have been several
statements along the lines "we will be conservative with language
development, and aggressive with the library." Likewise, there were
references to delivering a wider range of tools focussed on the
'general' user rather than the library developer, such as more systems
At various times there has been an expectation that some libraries
targetting TR2 might be part of C++0x, notably thread support and
the filesystem library. Likewise some of the smaller and less
controversial components might be considered for moving up the time-
If we work on the assumption we are targetting a standard in 2009, I
believe all technical work has to be completed around the Kona meeting
next year. On that timetable, the Library group already have a very
full agenda to incorporate the language changes. If there is concern
that the library needs some of the TR2 libraries up front, how much
would we be prepared to delay the standard waiting for them?
And how much would it matter if they were delivered 18 months later
as part of TR2?
How confident are the LWG that TR2 will deliver in the suggested
And are we sure that TR2 will indeed ship after the next standard? If
so, should we more eagerly embrace the new language features?
If the timetable is to work, there should be no doubt about the answers
to these questions by the end of the Portland meeting.