The ISO C++ Standard
Introduction#
In 1998, the there was a first publication of the standard making C++ an internally standardized language. From that time, C++ has evolved resulting in different dialects of C++. On this page, you can find an overview of all different standards and their changes compared to the previous version. The details on how to use these features is described on more specialized pages.
Remarks#
When C++ is mentioned, often a reference is made to “the Standard”. But what is exactly that standard?
C++ has a long history. Started as a small project by Bjarne Stroustrup within Bell Labs, by the early 90’s it had become quite popular. Multiple companies were creating C++ compilers so that users could run their C++ compilers on a wide range of computers. But in order to facilitate this, all these competing compilers should share a single definition of the language.
At that point, the C language had successfully been standardized. This means that a formal description of the language was written. This was submitted to the American National Standards Institute (ANSI), which opened up the document for review and subsequently published it in 1989. One year later, the International Organization for Standards (Because it would have different acronyms in different languages they chose one form, ISO, derived from the Greek isos, meaning equal.) adopted the American standard as an International Standard.
For C++, it was clear from the beginning that there was an international interest. A workgroup within ISO was started (known as WG21, within SubCommittee 22). This workgroup drafted a first standard around 1995. But as we programmers know, there’s nothing more dangerous to a planned delivery than last minute features, and that happened to C++ as well. In 1995, a cool new library named the STL surfaced, and the people working in WG21 decided to add a slimmed-down version to the C++ draft standard. Naturally, this caused the deadlines to be missed and only 3 years later did the document become final. ISO is a very formal organization, so the C++ Standard was christened with the not very marketable name of ISO/IEC 14882. As standards can be updated, this exact version became known as 14882:1998.
And indeed there was a demand to update the Standard. The Standard is a very thick document, which aims to exactly describe how C++ compilers should work. Even a slight ambiguity can be worth fixing, so by 2003 an update was released as 14882:2003. However, this did not add any feature to C++; the new features were scheduled for the second update.
Informally, this second update was known as C++0x, because it wasn’t known whether this would take until 2008 or 2009. Well - that version also got a slight delay, which is why it became 14882:2011.
Luckily, WG21 decided not to let that happen again. C++11 was well-received and let to a renewed interest in C++. So, to keep the momentum, the third update went from planning to publishing in 3 years, to become 14882:2014.
The work didn’t stop there, either. The C++17 standard has been proposed and the work for C++20 has been started.
Current Working Drafts
All published ISO standards are available for sale from the ISO store ( https://www.iso.org ). The working drafts of the C++ standards are publicly available for free though.
The different versions of the standard:
- Upcoming (Sometimes referred as C++20 or C++2a): Current working draft (HTML-version)
- Proposed (Sometimes referred as C++17 or C++1z): March 2017 working draft N4659.
- C++14 (Sometimes referred as C++1y): November 2014 working draft N4296
- C++11 (Sometimes referred as C++0x): February 2011 working draft N3242
- C++03
- C++98
C++11
The C++11 standard is a major extension to the C++ standard. Below you can find an overview of the changes as they have been grouped on the isocpp FAQ with links to more detailed documentation.
Language Extensions
General Features
- auto
- decltype
- Range-for statement
- Initializer lists
- Uniform initialization syntax and semantics
- Rvalue references and move semantics
- Lambdas
- noexcept to prevent exception propagation
- constexpr
- nullptr – a null pointer literal
- Copying and rethrowing exceptions
- Inline namespaces
- User-defined literals
Classes
- =default and =delete
- Control of default move and copy
- Delegating constructors
- In-class member initializers
- Inherited constructors
- Override controls: override
- Override controls: final
- Explicit conversion operators
Other Types
- enum class
- long long – a longer integer
- Extended integer types
- Generalized unions
- Generalized PODs
Templates
- Extern templates
- Template aliases
- Variadic templates
- Local types as template arguments
Concurrency
- Concurrency memory model
- Dynamic initialization and destruction with concurrency
- Thread-local storage
Miscellaneous Language Features
- What is the value of __cplusplus for C++11?
- Suffix return type syntax
- Preventing narrowing
- Right-angle brackets
- static_assert compile-time assertions
- Raw string literals
- Attributes
- Alignment
- C99 features
Library Extensions
General
- unique_ptr
- shared_ptr
- weak_ptr
- Garbage collection ABI
- tuple
- Type traits
- function and bind
- Regular Expressions
- Time utilities
- Random number generation
- Scoped allocators
Containers and Algorithms
- Algorithms improvements
- Container improvements
- unordered_* containers
- std::array
- forward_list
Concurrency
- Threads
- Mutual exclusion
- Locks
- Condition variables
- Atomics
- Futures and promises
- async
- Abandoning a process
C++14
The C++14 standard is often referred to as a bugfix for C++11. It contains only a limited list of changes of which most are extensions to the new features in C++11. Below you can find an overview of the changes as they have been grouped on the isocpp FAQ with links to more detailed documentation.
Language Extensions
- Binary literals
- Generalized return type deduction
- decltype(auto)
- Generalized lambda captures
- Generic lambdas
- Variable templates
- Extended
constexpr
- The
[[deprecated]]
attribute - Digit separators
Library Extensions
- Shared locking
- User-defined literals for
std::
types std::make_unique
- Type transformation
_t
aliases - Addressing tuples by type (e.g.
get<string>(t)
) - Transparent Operator Functors (e.g.
greater<>(x)
) std::quoted
Deprecated / Removed
std::gets
was deprecated in C++11 and removed from C++14std::random_shuffle
is deprecated
C++17
The C++17 standard is feature complete and has been proposed for standardization. In compilers with experimental support for these features, it is usually referred to as C++1z.
Language Extensions
- Fold Expressions
- declaring non-type template arguments with
auto
- Guaranteed copy elision
- Template parameter deduction for constructors
- Structured bindings
- Compact nested namespaces
- New attributes:
[[fallthrough]]
,[[nodiscard]]
,[[maybe_unused]]
- Default message for
static_assert
- Initializers in
if
andswitch
- Inline variables
if constexpr
- Order of expression evaluation guarantees
- Dynamic memory allocation for over-aligned data
Library Extensions
std::optional
std::variant
std::string_view
merge()
andextract()
for associative containers- A file system library with the
<filesystem>
header. - Parallel versions of most of the standard algorithms (in the
<algorithm>
header). - Addition of mathematical special functions in the
<cmath>
header. - Moving nodes between map<>, unordered_map<>, set<>, and unordered_set<>
C++03
The C++03 standard mainly addresses defect reports of the C++98 standard. Apart from these defects, it only adds one new feature.
Language Extensions
C++98
C++98 is the first standardized version of C++. As it was developed as an extension to C, many of the features which set apart C++ from C are added.
Language Extensions (in respect to C89/C90)
- Classes, Derived classes, virtual member functions, const member functions
- Function overloading, Operator overloading
- Single line comments (Has been introduced in the C-languague with C99 standard)
- References
- new and delete
- boolean type (Has been introduced in the C-languague with C99 standard)
- templates
- namespaces
- exceptions
- specific casts
Library Extensions
- The Standard Template Library
C++20
C++20 is the upcoming standard of C++, currently in development, based upon the C++17 standard. It’s progress can be tracked on the official ISO cpp website.
The following features are simply what has been accepted for the next release of the C++ standard, targeted for 2020.
Language Extensions
No language extensions have been accepted for now.
Library Extensions
No library extensions have been accepted for now.