Alisdair Meredith[TeamB] Guest
|
Posted: Tue Apr 24, 2007 8:10 am Post subject: Feedback from latest C++ committee meeting |
|
|
For the terminally curious, the latest C++ committee meeting was held
in Oxford last week, which was remarkably convenient for we locals <g>
Now that our self-imposed deadline of October is closing fast, the
future language is really coming into focus. While this meeting did
not specify the final feature-set, we now have an upper bound of what
might happen <g>
New features votes into C++0x working paper this meeting were variadic
templates, template aliases and unicode characters. New wording was
supplied defining the 'abstract machine' that will ultimately allow for
better concurrency support. This first step removed 'sequence points'.
Finally there was a little tweaking of wording so that 'sizeof' can be
used with non-static data members. This seems a first step to
loosening up what can be evaluated in the parens of
sizeof/typeid/decltype expressions.
Library voted in some major overhauls to support rvalue references/move
semantics and variadic templates. Type traits were revised, in
particular the compiler must supply black magic if necessary to always
give the right answer. Beman Dawes library for portable reporting of
system errors was brought forward from TR2, in antipation of thread
library support. A minimal level of support was added for the new
unicode char types e.g. basic_string support, but not regex. A couple
more 'algorithms' were added, such as next / prior / is_sorted. And
finally we killed the language lawyer objection to "Hello World" - in
the future #include <iostream> will be enough!
There was a full committee discussion on what to do with the special
math functions from TR1. For some domains these absolutely need to be
in an ISO standard to be usable (legal requirement for some government
work) The final decision was to create a new international standard
just for them - A Standard C++ Binding to ISO 31 (the standard that
defined which functions were important in the first place)
Several other proposals came close to acceptance. constexpr was pulled
from voting at the last minute when a problem related to a particularly
difficult Defect Report was found. This is also holding up decltype
and will hopefully be resolved in Toronto. Likewise, my own little
paper on adding __func__ from C99 to C++ was delayed one meeting until
the Defect Report it depends on moves from Review to Ready next meeting.
Several other propsals were reviewed by Core and will hopefully return
in Toronto with updates based on feedback - new style inititialization,
inheriting constructors, alignment control, nullptr, PODs cleanup and
strongly types enums. Explicit conversion operators will be reviewed
next meeting.
Interesting on the library side was a proposal to supping in-place
insertion into the standard containers via a new member function
(emplace) that takes the constructor arguments for the type to be
inserted. This is made possible by the new variadic templates. What
makes it so interesting is that it requires an extension to allocators
to support a variadic construct call, although there is no requirement
that this function is ever called (much like destroy). LWG has several
issues open on these functions, and the preference at this meeting was
therefore to remove them entirely, rather than add the extension. When
put to the vote on Friday this seemed a bigger step than the committee
were prepared to take in a single meeting, so we have until Toronto to
verify there will be no fall-out from this.
Major topics for discussion were garbage collection and threading
libraries. We hope to see proposals with full wording for both
presented at the Toronto meeting in July. The Library group were asked
to bring forward some threading ideas from TR2 into C++0x, specifically
Thread Pools and Futures.
Other news from evolution is that the work on Concepts is largely
complete, and wording for the standard will be available at the next
meeting. Lambda is still holding in there as possibly the latest late
addition we can handle, although attributes were proposed for the first
time at this meeting as a way to extend the language without stealing
keywords. Both seem to have been favourably received.
A new propsal from Lawrence Crowl would allow classes to generate the
implicitly declared version of special functions like the default
constructor - allowing derived classes to have user declared
constructors and retain trivial default ctor. A second part of this
paper allows declaring functions that can appear in the overload set,
but are a compile time error if selected. This is an improvement on
the current technique of making copy ctor/assignment operator private,
and also might be used to ban narrowing conversions. This is going
straight to Core.
A couple of proposals to allow 'raw' string literals to avoid escaping
'\\' characters, and another to support UTF8 string literals are also
going to Core at Toronto.
Another useful extension this meeting is to allow local types declared
in functions be used as template arguments. The common case is a
functor to be used in an algorithm, or a container of some local type.
It is usually a big surprise the first time you find this doesn't work.
Next meeting is in Toronto in 3 months, and should be even busier!
--
AlisdairM(TeamB) |
|