C++ Standardization

Posted by Yulai Blog on November 6, 2015

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.

C++ standards draft on Github

Year C++ Standard Informal name
1998 ISO/IEC 14882:1998 C++98
2003 ISO/IEC 14882:2003 C++03
2007 ISO/IEC TR 19768:2007 C++07/TR1
2011 ISO/IEC 14882:2011 C++11
2014 ISO/IEC 14882:2014 C++14
2017 to be determined C++17

<img src=”https://isocpp.org/files/img/wg21-timeline.png” width=695px>

History of C++

C++98

  • ISO/IEC 14882:1998
  • The [C++ programming language] was initially standardized in 1998
    1
    
      ~$ g++ -std=c++98 hello.cc -o hello
    

C++03

  • 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]
    1
    
      ~$ g++ -std=c++03 hello.cc -o hello
    

C++07/TR1

  • 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::tr1 namespace 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.
    1
    
      ~$ g++ -std=c++0x hello.cc -o hello
    

C++11

  • ISO/IEC 14882:2011
  • C++0x
  • 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

C++14

  • 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

  • __GNUC__
  • __GNUC_MINOR__
  • __GNUC_PATCHLEVEL__

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__ to 3, __GNUC_MINOR__ to 2, and __GNUC_PATCHLEVEL__ to 1.