C++ is standardized by an ISO working group known as JTC1/SC22/WG21. So far, it has seen five versions of C++ released and is currently working on releasing C++17.
|Year||C++ Standard||Informal name|
|2007||ISO/IEC TR 19768:2007||C++07/TR1|
|2017||to be determined||C++17|
- ISO/IEC 14882:1998
- The [C++ programming language] was initially standardized in 1998
~$ g++ -std=c++98 hello.cc -o hello
- ISO/IEC 14882:2003
- Final draft
- From a programmer’s view there is none difference between C++98 and C++03.
- The C++03 revision of the standard was a bug fix release.
- [Gcc manual 4.3.6]
~$ g++ -std=c++03 hello.cc -o hello
- ISO/IEC TR 19768:2007
- Library Technical Report 1 (TR1) is the common name for ISO/IEC TR 19768, C++ Library Extensions which was a document proposing additions to the C++ standard library for the C++03 language standard.
- The new components were defined in the
std::tr1namespace to distinguish them from the then-current standard library.
- Most of TR1 was available from [Boost].
- TR1 was not a standard itself, but most of its proposals became part of the later official standard, C++11.
- Draft Technical Report on C++ Library Extensions N1836.
~$ g++ -std=c++0x hello.cc -o hello
- ISO/IEC 14882:2011
- The working draft most similar to the published C++11 standard is N3337, dated 16 January 2012.
- Support in GCC 4.7 and later
- [GCC manual 4.7.4]
1 ~$ g++ -std=c++11 hello.cc -o hello
- ISO/IEC 14882:2014
- Last publicly available draft [N3797]
- November 2014 working draft [N4296]
- Support in GCC 5.2 and later: GCC 5 Release Series Changes
- [GCC manual 5.2.0]
1 ~$ g++ -std=c++14 hello.cc -o hello
GCC provides some extensions to the C++ language.
By default, if no C++ language dialect options are given, is ‘-std=gnu++98’.
~$ g++ -std=gnu++98 (extensions for c++98) ~$ g++ -std=gnu++03 (extensions for c++03) ~$ g++ -std=gnu++11 (extensions for c++11)
These macros are defined by GNU compilers GCC Common Predefined Macros
These macros are defined by all GNU compilers that use the C preprocessor: C, C++, Objective-C and Fortran. Their values are the major version, minor version, and patch level of the compiler, as integer constants. For example, GCC 3.2.1 will define
__GNUC_MINOR__to 2, and