C++11 is the second major version of C++ 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:
exception_ptr, error_code and error_condition, iterator improvements (begin, end, next, prev) auto and decltype final and override constexpr and literal types nullptr long long noexcept specifier and noexcept operator alignof and alignas static_assert (based on a Boost library) <array> <atomic> <cfenv> <chrono> <cinttypes> <condition_variable> <cstdint> <cuchar> <forward_list> <future> <initializer_list> <mutex> <random> <ratio> <regex> <scoped_allocator> <system_error> <thread> <tuple> <typeindex> <type_traits> <unordered_map> <unordered_set> emplace() and other use of rvalue references throughout all parts of the existing library std::unique_ptr std::move_iterator std::initializer_list std::forward_list std::all_of, std::any_of, std::none_of, std::find_if_not, std::copy_if, std::copy_n, std::move, std::move_backward, std::random_shuffle, std::shuffle, std::is_partitioned, std::partition_copy, std::partition_point, std::is_sorted, std::is_sorted_until, std::is_heap, std::is_heap_until, std::minmax, std::minmax_element, std::is_permutation, std::iota, std::uninitialized_copy_n std::function std::exception_ptr std::error_code and std::error_condition Main Article: C++11 compiler support.
| C++11 feature | Paper(s) | GCC | Clang | MSVC | Apple Clang | EDG eccp | Intel C++ | IBM XLC++ | Sun/Oracle C++ | Embarcadero C++ Builder | Cray | Nvidia HPC C++ (ex Portland Group/PGI) | Nvidia nvcc | HP aCC | Digital Mars C++ | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| C99 preprocessor | N1653 | 4.3 | Yes |
19.0 (2015)* (partial)* 19.26* | Yes | 4.1 | 11.1 | 10.1 | 5.9 | Yes | 8.4 | 2015 | 7.0 | A.06.25 | Yes | |
static_assert | N1720 | 4.3 | 2.9 | 16.0* | Yes | 4.1 | 11.0 | 11.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.25 | 8.52 | |
| Right angle brackets | N1757 | 4.3 | Yes | 14.0* | Yes | 4.1 | 11.0 | 12.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | |||
Extended friend declarations | N1791 | 4.7 | 2.9 |
16.0* (partial) 18.0* | Yes | 4.1 |
11.1* 12.0 | 11.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.25 | ||
long long | N1811 | Yes | Yes | 14.0* | Yes | Yes | Yes | Yes | Yes | Yes | 8.4 | 2015 | 7.0 | Yes | Yes | |
| Compiler support for type traits | N1836 N2518* N2984 N3142 |
4.3* 4.8* 5 | 3.0 |
14.0* (partial)* 19.0 (2015)* | Yes | 4.0 | 10.0 | 13.1.3 | 5.13 | Yes | 8.4 | 2015 | 6.16 | |||
auto | N1984 | 4.4 | Yes | 16.0* | Yes | 3.9 | 11.0 (v0.9) 12.0 | 11.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.25 | ||
| Delegating constructors | N1986 | 4.7 | 3.0 | 18.0* | Yes | 4.7 | 14.0 | 11.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.28 | ||
extern template | N1987 | 3.3 | Yes | 12.0* | Yes | 3.9 | 9.0 | 11.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.25 | ||
constexpr | N2235 | 4.6 | 3.1 | 19.0 (2015)* | Yes | 4.6 |
13.0* 14.0 |
12.1* 13.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.28 | ||
| Template aliases | N2258 | 4.7 | 3.0 | 18.0* | Yes | 4.2 | 12.1 | 13.1.1* | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.27 | ||
char16_t and char32_t | N2249 | 4.4 | 2.9 | 19.0 (2015)* | Yes | 4.4 |
12.1* 14.0 | 13.1.1* | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.27 | 8.52 | |
alignas | N2341 | 4.8 | 3.0 | 19.0 (2015)* | Yes | 4.8 | 15.0 | 13.1.2* | 5.13 | Yes | 8.6 | 2015 | 7.0 | |||
alignof | N2341 | 4.5 | 2.9 | 19.0 (2015)* | Yes | 4.8 | 15.0 | 13.1.2* | 5.13 | Yes | 8.4 | 2015 | 7.0 | |||
| Defaulted and deleted functions | N2346 | 4.4 | 3.0 | 18.0* | Yes | 4.1 | 12.0 | 13.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.25 | ||
Strongly-typed enum | N2347 | 4.4 | 2.9 | 17.0* | Yes | 4.0 | 13.0 | 12.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.25 | ||
| Atomic operations | N2427 | 4.4 | 3.1 | 17.0* | Yes | Yes | 13.0 | 13.1.2* | 5.14 | Yes | 8.4 | 2015 | ||||
nullptr | N2431 | 4.6 | 2.9 | 16.0* | Yes | 4.2 | 12.1 | 13.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.27 | 8.52 | |
| Explicit conversion operators | N2437 | 4.5 | 3.0 | 18.0* | Yes | 4.4 | 13.0 | 12.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.27 | ||
| ref-qualifiers | N2439 | 4.8.1 | 2.9 | 19.0 (2015)* | Yes | 4.7 | 14.0 | 13.1.2* | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.28 | ||
| Unicode string literals | N2442 | 4.4 | 3.0 | 19.0 (2015)* | Yes | 4.7 | 11.0* |
10.1* 13.1.1* | 5.7 | Yes | 8.4 | 2015 | 7.0 | A.06.28 | 8.52 | |
| Raw string literals | N2442 | 4.5 | Yes | 18.0* | Yes | 4.7 | 14.0 | 13.1.1, except AIX xlC 13.1.3* | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.28 | 8.52 | |
| Inline namespaces | N2535 | 4.4 | 2.9 | 19.0 (2015)* | Yes | 4.5 | 14.0 | 11.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.28 | ||
| Inheriting constructors | N2540 | 4.8 | 3.3 | 19.0 (2015)* | Yes | 4.8 | 15.0 | 13.1.1* | 5.13 | Yes | 8.4 | 2015 | 7.0 | |||
| Trailing function return types | N2541 | 4.4 | 2.9 | 16.0* | Yes | 4.1 | 12.0 | 12.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.27 | ||
| Unrestricted unions | N2544 | 4.6 | 3.0 | 19.0 (2015)* | Yes | 4.6 | 14.0* | 13.1.2* | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.28 | ||
| Variadic templates | N2242 N2555 | 4.3 (N2242) 4.4 | 2.9 | 18.0* | Yes | 4.3 (N2242) 4.3 | 12.1 | 11.1 (N2242) | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.27 | ||
| Expression SFINAE | N2634 | 4.4 | 2.9 | 19.14* | Yes | 4.2 | 12.1 | Yes | 8.4 | 2015 | 7.0 | |||||
| Local and unnamed types as template parameters | N2657 | 4.5 | 2.9 | 16.0* | Yes | 4.2 | 12.0 | 13.1.2* | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.27 | ||
| Thread-local storage | N2659 | 4.4 (partial) 4.8 | 3.3* |
16.0* (partial) 19.0 (2015)* | Yes | 4.8 | 11.1 (partial) 15.0* |
10.1 (partial)* 13.1.2 (partial)* | 5.9 (partial) | Yes | 8.4 | 2015 | 8.52 (partial) | |||
| Dynamic initialization and destruction with concurrency (magic statics) | N2660 | 4.3 | 2.9 | 19.0 (2015)* | Yes | Yes | 11.1* | 13.1.2* | 5.13 | Yes | 8.4 | 2015 | A.06.25 | |||
| Garbage Collection and Reachability-Based Leak Detection | N2670 | |||||||||||||||
| Initializer lists | N2672 | 4.4 | 3.1 | 18.0* | Yes | 4.5 | 13.0 (partial) 14.0 | 13.1.2* | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.28 | ||
| Non-static data member initializers | N2756 | 4.7 | 3.0 | 18.0* | Yes | 4.6 | 14.0 | 13.1.2* | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.28 | ||
| Attributes | N2761 | 4.8 | 3.3 | 19.0 (2015)* | Yes | 4.2 | 12.1 | 13.1.1* | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.27 | ||
Forward (opaque) enum declarations | N2764 | 4.6 | 3.1 | 17.0* | Yes | 4.5 | 11.1 (partial) 14.0 | 12.1 | 5.13 | Yes | 8.4 | 2015 | 7.0 | |||
| User-defined literals | N2765 | 4.7 | 3.1 | 19.0 (2015)* | Yes | 4.8 | 15.0 | 13.1.2* | 5.14 | Yes | 8.4 | 2015 | 7.0 | |||
| Rvalue references | N2118 N2844 CWG1138 | 4.3 (N2118) 4.5 | 2.9 |
16.0* (N2844) 17.0* | Yes | 4.5 | 11.1 (N2118) 12.0 (N2844) 14.0 | 12.1 | 5.13 | Yes | 8.4 | 2015 | 7.0* | A.06.25 | ||
| Lambda expressions | N2550 N2658 N2927 | 4.5 | 3.1 |
16.0* (N2658) 17.0* | Yes | 4.1 | 12.0 | 13.1.2* | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.25 | ||
| Range-for loop | N2930 N3271 | 4.6 | 3.0 | 17.0* | Yes | 4.5 | 13.0 | 13.1.2* | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.28 | ||
noexcept | N3050 | 4.6 | 3.0 | 19.0 (2015)* | Yes | 4.5 | 14.0 | 13.1.1* | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.28 | ||
| Defaulted move special member functions | N3053 | 4.6 | 3.0 | 19.0 (2015)* | Yes | 4.5 | 14.0 | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.25 | |||
override and final | N2928 N3206 N3272 | 4.7 | 2.9 |
14.0* (partial) 17.0* | Yes | 4.8 | 12.0 (N2928) 14.0 | 13.1.1* | 5.13 | Yes | 8.4 | 2015 | 7.0 | |||
decltype | N2343 N3276 | 4.3 (N2343) 4.8.1 | 2.9 | 16.0* | Yes | 4.2 (N2343) 4.8 | 11.0 (N2343) 12.0 | 11.1 (N2343) | 5.13 | Yes | 8.4 | 2015 | 7.0 | A.06.25 | 8.52 (N2343) | |
| C++11 feature | Paper(s) | GCC | Clang | MSVC | Apple Clang | EDG eccp | Intel C++ | IBM XLC++ | Sun/Oracle C++ | Embarcadero C++ Builder | Cray | Nvidia HPC C++ (ex Portland Group/PGI) | Nvidia nvcc | HP aCC | Digital Mars C++ |
| C++11 feature | Paper(s) | GCC libstdc++ | Clang libc++ | MSVC STL | Apple Clang | Sun/Oracle C++ Standard Library | Embarcadero C++ Builder Standard Library | |
|---|---|---|---|---|---|---|---|---|
| Type traits | N1836 N2240 N2244 N2255 N2342 N2984 N3142 |
4.3* 4.8* 5 | 3.0 |
14.0* (partial)* 19.0 (2015)* | Yes | 5.13 | Yes | |
| Garbage Collection and Reachability-Based Leak Detection (library support) | N2670 | 6 (no-op)* | 3.4 (no-op)* |
19.0 (2015)* (no-op)* | Yes (no-op)* | |||
| Money, Time, and hexfloat I/O manipulators | N2071 N2072 | 5 | 3.8 | 19.0 (2015)* | Yes | 5.15 | ||
Disallowing COW (copy-on-write) std::basic_string | N2668 | 5 | Yes | Yes | Yes | Yes | ||
| Regular expressions library | N1429 | 4.9 | ? | ? | Yes | |||
| C++11 feature | Paper(s) | GCC libstdc++ | Clang libc++ | MSVC STL | Apple Clang | Sun/Oracle C++ Standard Library | Embarcadero C++ Builder Standard Library |
* - hover over a cell marked with the star * to see additional pop-up notes.
DRnn - the number nn after "DR" denotes target C++ revision the Defect Report is applied to, e.g., DR20 → C++20.
| Working C++11 examples |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/11