C++11

来自cppreference.com
< cpp

C++11 is the second major version of C++ (the previous one is C++98 and the next one is C++17) and the most important update since C++98. A large number of changes were introduced to both standardize existing practices and improve the abstractions available to the C++ programmers.

Before it was finally approved by ISO on 12 August 2011, the name 'C++0x' was used because it was expected to be published before 2010. It took 8 years between C++03 and C++11, so it has become the longest interval between versions so far. Since then, currently, C++ updates every 3 years regularly.

Following features were merged into C++11:

目录

[编辑] Core language features

[编辑] Library features

[编辑] Headers

[编辑] Library features

[编辑] Defect reports

C++11 中修正的缺陷报告(核心 741 个,库 685 个)

[编辑] Compiler support

Main Article: C++ compiler support

[编辑] C++11 核心语言功能特性

C++11 功能特性
 
提案
 
GCC
Clang
MSVC
Apple Clang
EDG eccp
Intel C++
IBM XLC++
Sun/Oracle C++
Embarcadero C++ Builder
Cray
Portland Group (PGI)
Nvidia nvcc
HP aCC
Digital Mars C++
C99 预处理器 N1653 4.3 19.0* (部分)*
19.26*
4.1 11.1 10.1 5.9 8.4 2015 7.0 A.06.25
static_assert N1720 4.3 2.9 16.0* 4.1 11.0 11.1 5.13 8.4 2015 7.0 A.06.25 8.52
右角括号 N1757 4.3 14.0* 4.1 11.0 12.1 5.13 8.4 2015 7.0
扩展的 friend 声明 N1791 4.7 2.9 16.0* (部分)
18.0*
4.1 11.1 (部分)
12.0
11.1 5.13 8.4 2015 7.0 A.06.25
long long N1811 14.0* 8.4 2015 7.0
类型特征的编译器支持 N1836 4.3 3.0 14.0* 4.0 10.0 13.1.3 5.13 8.4 2015 6.16
auto N1984 4.4 16.0* 3.9 11.0 (v0.9)
12.0
11.1 5.13 8.4 2015 7.0 A.06.25
委托构造函数 N1986 4.7 3.0 18.0* 4.7 14.0 11.1 5.13 8.4 2015 7.0 A.06.28
extern template N1987 3.3 12.0* 3.9 9.0 11.1 5.13 8.4 2015 7.0 A.06.25
constexpr N2235 4.6 3.1 19.0* 4.6 13.0 (部分)
14.0
12.1 (部分)
13.1
5.13 8.4 2015 7.0 A.06.28
模板别名 N2258 4.7 3.0 18.0* 4.2 12.1 13.1.1* 5.13 8.4 2015 7.0 A.06.27
char16_tchar32_t N2249 4.4 2.9 19.0* 4.4 12.1*
14.0
13.1.1* 5.13 8.4 2015 7.0 A.06.27 8.52
alignas N2341 4.8 3.0 19.0* 4.8 15.0 13.1.2* 5.13 8.6 2015 7.0
alignof N2341 4.5 2.9 19.0* 4.8 15.0 13.1.2* 5.13 8.4 2015 7.0
默认化与被删除的函数 N2346 4.4 3.0 18.0* 4.1 12.0 13.1 5.13 8.4 2015 7.0 A.06.25
强类型 enum N2347 4.4 2.9 17.0* 4.0 13.0 12.1 5.13 8.4 2015 7.0 A.06.25
原子操作 N2427 4.4 3.1 17.0* Yes 13.0 13.1.2* 5.14 8.4 2015
nullptr N2431 4.6 2.9 16.0* 4.2 12.1 13.1 5.13 8.4 2015 7.0 A.06.27 8.52
显式转换运算符 N2437 4.5 3.0 18.0* 4.4 13.0 12.1 5.13 8.4 2015 7.0 A.06.27
引用限定符 N2439 4.8.1 2.9 19.0* 4.7 14.0 13.1.2* 5.13 8.4 2015 7.0 A.06.28
Unicode 字符串字面量 N2442 4.4 3.0 19.0* 4.7 11.0* 10.1*
13.1.1*
5.7 8.4 2015 7.0 A.06.28 8.52
未处理的字符串字面量 N2442 4.5 18.0* 4.7 14.0 13.1.1* 5.13 8.4 2015 7.0 A.06.28 8.52
内联命名空间 N2535 4.4 2.9 19.0* 4.5 14.0 11.1 5.13 8.4 2015 7.0 A.06.28
继承构造函数 N2540 4.8 3.3 19.0* 4.8 15.0 13.1.1* 5.13 8.4 2015 7.0
尾随的函数返回类型 N2541 4.4 2.9 16.0* 4.1 12.0 12.1 5.13 8.4 2015 7.0 A.06.27
无限制的联合体 N2544 4.6 3.0 19.0* 4.6 14.0* 13.1.2* 5.13 8.4 2015 7.0 A.06.28
变参数模板 N2242
N2555
4.3 (N2242)
4.4
2.9 18.0* 4.3 (N2242)
4.3
12.1 11.1 (N2242) 5.13 8.4 2015 7.0 A.06.27
表达式 SFINAE N2634 4.4 2.9 19.14* 4.2 12.1 8.4 2015 7.0
局部与无名类型作为模板形参 N2657 4.5 2.9 16.0* 4.2 12.0 13.1.2* 5.13 8.4 2015 7.0 A.06.27
线程局部存储 N2659 4.4 (部分)
4.8
3.3* 16.0* (部分)
19.0*
4.8 11.1 (部分)
15.0*
10.1 (部分)*
13.1.2 (部分)*
5.9 (部分) 8.4 2015 8.52 (部分)
带并发的动态初始化与析构(魔法静态变量 N2660 4.3 2.9 19.0* Yes 11.1* 13.1.2* 5.13 8.4 2015 A.06.25
垃圾收集与基于可达性的泄漏检测 N2670
初始化器列表 N2672 4.4 3.1 18.0* 4.5 13.0 (部分)
14.0
13.1.2* 5.13 8.4 2015 7.0 A.06.28
非静态数据成员初始化器 N2756 4.7 3.0 18.0* 4.6 14.0 13.1.2* 5.13 8.4 2015 7.0 A.06.28
属性 N2761 4.8 3.3 19.0* 4.2 12.1 13.1.1* 5.13 8.4 2015 7.0 A.06.27
前置 enum 声明 N2764 4.6 3.1 17.0* 4.5 11.1 (部分)
14.0
12.1 5.13 8.4 2015 7.0
用户定义的字面量 N2765 4.7 3.1 19.0* 4.8 15.0 13.1.2* 5.14 8.4 2015 7.0
右值引用 N2118
N2844
CWG1138
4.3 (N2118)
4.5
2.9 16.0* (N2844)
17.0*
4.5 11.1 (N2118)
12.0 (N2844)
14.0
12.1 5.13 8.4 2015 7.0* A.06.25
Lambda 表达式 N2550
N2658
N2927
4.5 3.1 16.0* (N2658)
17.0*
4.1 12.0 13.1.2* 5.13 8.4 2015 7.0 A.06.25
范围 for 循环 N2930 4.6 3.0 17.0* 4.5 13.0 13.1.2* 5.13 8.4 2015 7.0 A.06.28
noexcept N3050 4.6 3.0 19.0* 4.5 14.0 13.1.1* 5.13 8.4 2015 7.0 A.06.28
移动特殊成员函数 N3053 4.6 3.0 19.0* 4.5 14.0 5.13 8.4 2015 7.0 A.06.25
overridefinal N2928
N3206
N3272
4.7 2.9 14.0* (部分)
17.0*
4.8 12.0 (N2928)
14.0
13.1.1* 5.13 8.4 2015 7.0
decltype N2343
N3276
4.3 (N2343)
4.8.1
2.9 16.0* 4.2 (N2343)
4.8
11.0 (N2343)
12.0
11.1 (N2343) 5.13 8.4 2015 7.0 A.06.25 8.52 (N2343)
C++11 功能特性
 
提案
 
GCC
Clang
MSVC
Apple Clang
EDG eccp
Intel C++
IBM XLC++
Sun/Oracle C++
Embarcadero C++ Builder
Cray
Portland Group (PGI)
Nvidia nvcc
HP aCC
Digital Mars C++

[编辑] C++11 库功能特性

C++11 功能特性
 
提案
 
GCC libstdc++
Clang libc++
MSVC
标准库
Apple Clang
Sun/Oracle C++
标准库
Embarcadero C++ Builder
标准库
Cray C++
标准库
类型特征 N1836 4.3 3.0 14.0* 5.13 8.4
垃圾收集与基于可达性的泄漏检测(库支持 N2670 6
(无操作)
3.4
(无操作)
19.0*
(无操作)

(无操作)
金额、时间及十六进制浮点 I/O 操纵符 N2071
N2072
5 3.8 19.0* 5.15
C++11 功能特性
 
提案
 
GCC libstdc++
Clang libc++
MSVC
标准库
Apple Clang
Sun/Oracle C++
标准库
Embarcadero C++ Builder
标准库
Cray C++
标准库

* - 在版本号上停留可以查看注记