C++0x is the working name of the next ISO C++ standard, due by the end of this decade, which introduces a host of new features into the standard C++ language and library. This project seeks to implement new C++0x features in GCC and to make it one of the first compilers to bring C++0x to C++ programmers.
C++0x features are available as part of the "mainline" GCC
compiler in the trunk of
GCC's Subversion
repository and in GCC 4.3 and later. To enable C++0x
support, add the command-line parameter -std=c++0x
to your g++ command line. Or, to enable GNU
extensions in addition to C++0x extensions,
add -std=gnu++0x to your g++ command
line.
Important: because the ISO C++0x draft is still evolving, GCC's support for C++0x is experimental. No attempt will be made to maintain backward compatibility with implementations of C++0x features that do not reflect the final C++0x standard.
The following table lists new language features that have been accepted into the C++0x draft standard. The "Proposal" column provides a link to the ISO C++ committee proposal that describes the feature, while the "Available in GCC?" column indicates the first version of GCC that contains an implementation of this feature (if it has been implemented). For the most complete and up-to-date information about new language features in C++0x, please see the ISO C++ Committee Papers and look for the most recent "State of C++ Evolution" paper by Alisdair Meridith.
For information about C++0x support in a specific version of GCC, please see:
| Language Feature | Proposal | Available in GCC? |
|---|---|---|
| Rvalue references | N2118 | GCC 4.3 |
Rvalue references for *this |
N2439 | No |
| Variadic templates | N2242 | GCC 4.3 |
| Extending variadic template template parameters | N2555 | GCC 4.4 |
| Initializer lists | N2672 | GCC 4.4 |
| Static assertions | N1720 | GCC 4.3 |
auto-typed variables |
N1984 | GCC 4.4 |
Multi-declarator auto |
N1737 | No |
| Removal of auto as a storage-class specifier | N2546 | GCC 4.4 |
| New function declarator syntax | N2541 | GCC 4.4 |
| Lambda expressions and closures | N2550 | Under development [Branch] |
| Constness of lambda functions | N2658 | No |
| Declared type of an expression | N2343 | GCC 4.3 |
| Right angle brackets | N1757 | GCC 4.3 |
| Default template arguments for function templates | DR226 | GCC 4.3 |
| Solving the SFINAE problem for expressions | DR339 | GCC 4.4 |
| Template aliases | N2258 | No |
| Extern templates | N1987 | Yes |
| Null pointer constant | N2431 | No |
| Strongly-typed enums | N2347 | GCC 4.4 |
| Generalized constant expressions | N2235 | No |
| Alignment support | N2341 | No |
| Delegating constructors | N1986 | No [Patch] |
| Inheriting constructors | N2540 | No |
| Explicit conversion operators | N2437 | No |
| New character types | N2249 | No |
| Raw and Unicode string literals | N2442 | No |
| Extended PODs | N2342 | No |
| Initialization of class objects by rvalues | N1610 | No |
| Extended friend declarations | N1791 | No |
Extending sizeof |
N2253 | No |
| Universal character name literals | N2170 | No |
| Defaulted and deleted functions | N2346 | GCC 4.4 |
| Inline namespaces | N2535 | GCC 4.4 |
| Unrestricted unions | N2544 | No |
| Local and unnamed types as template arguments | N2657 | No |
| Minimal support for garbage collection and reachability-based leak detection | N2670 | No |
| Concurrency | ||
| Sequence points | N2239 | No |
| Atomic operations | N2427 | No |
| Memory model | N2429 | No |
| C++ data-dependency ordering: atomics and memory model | N2664 | No |
| Copying and rethrowing exceptions | N2179 | No |
| Abandoning a process | N2440 | No |
| Allow atomics use in signal handlers | N2547 | No |
| Thread-local storage | N2659 | No |
| Dynamic initialization and destruction with concurrency | N2660 | No |
| C99 Features in C++0x | ||
__func__ predefined identifier |
N2340 | GCC 4.3 |
| C99 preprocessor | N1653 | GCC 4.3 |
long long |
N1811 | GCC 4.3 |
| Extended integral types | N1988 | No |
| Likely C++0x Features | ||
| Concepts | N2421 | Under development [Branch] |
Support for
the Concepts
feature, which is a likely candidate for inclusion in C++0x, is under
development on a separate development
branch, branches/cxx0x-concepts-branch in
the GCC Subversion repository. This branch
is maintained by Jason Merrill
<jason@redhat.com>.
branches/conceptgcc-branch. gcc/testsuite/g++.dg/concepts. ChangeLog.concepts in the appropriate
subdirectory.Support for
lambda functions,
which is in the working draft of C++0x, is under development in a separate
branch, branches/cxx0x-lambdas-branch, in
the GCC Subversion repository. This branch
is maintained by John Freeman
<jfreeman08@gmail.com>.
Please send FSF & GNU inquiries & questions to gnu@gnu.org. There are also other ways to contact the FSF.
These pages are maintained by the GCC team.
For questions related to the use of GCC, please consult these web pages and the GCC manuals. If that fails, the gcc-help@gcc.gnu.org mailing list might help.Copyright (C) Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.
| Last modified 2008-12-03 |
|