C++11
From cppreference.com
< cpp
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.
This section is incomplete |
Following features were merged into C++11:
- From TR1: all of TR1 except Special Functions.
- From Boost: The thread library, exception_ptr, error_code and error_condition, iterator improvements (begin, end, next, prev)
- From C: C-style Unicode conversion functions
Contents |
[edit] Core language features
- auto and decltype
- defaulted and deleted functions
- final and override
- trailing return type
- rvalue references
- move constructors and move assignment operators
- scoped enums
- constexpr and literal types
- list initialization
- delegating and inherited constructors
- brace-or-equal initializers
- nullptr
- long long
- char16_t and char32_t
- type aliases
- variadic templates
- generalized (non-trivial) unions
- generalized PODs (trivial types and standard-layout types)
- Unicode string literals
- user-defined literals
- attributes
- lambda expressions
- noexcept specifier and noexcept operator
- alignof and alignas
- multithreaded memory model
- thread-local storage
- GC interface (removed in C++23)
- range-for (based on Boost library)
- static_assert (based on Boost library)
This section is incomplete |
[edit] Library features
[edit] Headers
- <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>
[edit] Library features
- concurrency support library
-
emplace()
and other use of rvalue references throughout all parts of the existing library - std::unique_ptr
- std::move_iterator
- std::initializer_list
- stateful and scoped allocators
- std::forward_list
- chrono library
- ratio library
- new algorithms:
- 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
- Unicode conversion facets
- std::function
- std::exception_ptr
- std::error_code and std::error_condition
- iterator improvements:
This section is incomplete |