C++ - C++0x/C++11 Support in GCC




C++0x was the working name of the ISO C++ 2011 standard, which introduced a host of new features into the standard C++ language and library. This project sought to implement new C++11 features in GCC, and made it the first compiler to bring feature-complete C++11 to C++ programmers.

C++11 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. GCC 4.7 and later support -std=c++11 and -std=gnu++11 as well.

Important: GCC's support for C++11 is still experimental. Some features were implemented based on early proposals, and no attempt will be made to maintain backward compatibility when they are updated to match the final C++11 standard.

C++11 Language Features

The following table lists new language features that have been accepted into the C++11 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 information about C++11 support in a specific version of GCC, please see:

Language FeatureProposalAvailable in GCC?SD-6 Feature Test
Rvalue referencesN2118GCC 4.3__cpp_rvalue_references >= 200610
    Rvalue references for *thisN2439GCC 4.8.1__cpp_ref_qualifiers >= 200710
Initialization of class objects by rvaluesN1610Yes 
Non-static data member initializersN2756GCC 4.7__cpp_nsdmi >= 200809
Variadic templatesN2242GCC 4.3__cpp_variadic_templates >= 200704
    Extending variadic template template parametersN2555GCC 4.4 
Initializer listsN2672GCC 4.4__cpp_initializer_lists >= 200806
Static assertionsN1720GCC 4.3__cpp_static_assert >= 200410
auto-typed variablesN1984GCC 4.4 
    Multi-declarator autoN1737GCC 4.4 
    Removal of auto as a storage-class specifierN2546GCC 4.4 
    New function declarator syntaxN2541GCC 4.4 
New wording for C++0x lambdasN2927GCC 4.5__cpp_lambdas >= 200907
Declared type of an expressionN2343GCC 4.3__cpp_decltype >= 200707
    decltype and call expressionsN3276GCC 4.8.1 
Right angle bracketsN1757GCC 4.3 
Default template arguments for function templatesDR226GCC 4.3 
Solving the SFINAE problem for expressionsDR339GCC 4.4 
Template aliasesN2258GCC 4.7__cpp_alias_templates >= 200704
Extern templatesN1987Yes 
Null pointer constantN2431GCC 4.6 
Strongly-typed enumsN2347GCC 4.4 
Forward declarations for enumsN2764 GCC 4.6 
Generalized attributesN2761GCC 4.8__cpp_attributes >= 200809; __has_cpp_attribute(noreturn) >= 200809; __has_cpp_attribute(carries_dependency) == 0 (not implemented)
Generalized constant expressionsN2235GCC 4.6__cpp_constexpr >= 200704
Alignment supportN2341GCC 4.8 
Delegating constructorsN1986GCC 4.7__cpp_delegating_constructors >= 200604
Inheriting constructorsN2540GCC 4.8__cpp_inheriting_constructors >= 200802
Explicit conversion operatorsN2437GCC 4.5 
New character typesN2249GCC 4.4__cpp_unicode_characters >= 200704
Unicode string literalsN2442GCC 4.5__cpp_unicode_literals >= 200710
Raw string literalsN2442GCC 4.5__cpp_raw_strings >= 200710
Universal character name literalsN2170GCC 4.5 
User-defined literalsN2765GCC 4.7__cpp_user_defined_literals >= 200809
Standard Layout TypesN2342GCC 4.5 
Defaulted and deleted functionsN2346GCC 4.4 
Extended friend declarationsN1791GCC 4.7 
Extending sizeofN2253GCC 4.4 
Inline namespacesN2535GCC 4.4 
Unrestricted unionsN2544GCC 4.6 
Local and unnamed types as template argumentsN2657GCC 4.5 
Range-based forN2930GCC 4.6__cpp_range_based_for >= 200907
Explicit virtual overridesN2928
N3206
N3272
GCC 4.7 
Minimal support for garbage collection and reachability-based leak detectionN2670No 
Allowing move constructors to throw [noexcept]N3050GCC 4.6 
Defining move special member functionsN3053GCC 4.6 
Concurrency
Sequence pointsN2239Yes 
Atomic operationsN2427GCC 4.4 
Strong Compare and ExchangeN2748GCC 4.5 
Bidirectional FencesN2752GCC 4.8 
Memory modelN2429GCC 4.8 
Data-dependency ordering: atomics and memory modelN2664GCC 4.4
(memory_order_consume)
 
Propagating exceptionsN2179GCC 4.4 
Abandoning a process and at_quick_exitN2440GCC 4.8 
Allow atomics use in signal handlersN2547Yes 
Thread-local storageN2659GCC 4.8 
Dynamic initialization and destruction with concurrencyN2660GCC 4.3 
C99 Features in C++11
__func__ predefined identifierN2340GCC 4.3 
C99 preprocessorN1653GCC 4.3 
long longN1811GCC 4.3 
Extended integral typesN1988Yes 

C++11 Library Features

The status of the library implementation can be tracked in this table


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值