Origin

C++ was created by Bjarne Stroustrup. Dr. Stroustrup created C++ as a direct descendant of C language (specifically, descendant of Classic C and C89). C++ is not a descendant of C99 (therefore they are siblings). 1

C++ supports data abstraction, object-oriented programming (OOP), and generic programming. C++ can be considered a better language than C because C++ supports more programming styles, while being a superset of C. Some programmers write in C++ but only use C functionality (e.g., C99).

Standards Committee

C++ is standardized by the ISO (International Organization for Standardization) and the IEC (International Electrotechnical Commission), typically referred to as the “ISO Committee”. The ISO/IEC C++ Committee was founded in 1991, thus before 1991, the standards did not have official ISO standard. The official C++ standard is named ISO/IEC 14882:YEAR. For example, C++2020 is named ISO/IEC 14882:2020.

ISO collaborates with other national standard organizations, such as ANSI (The American National Standards Institute), BSI (The British Standards Institute), and DIN (The German national standards organization) 1.

Bjarne Stroustrup is a founding member of the ISO C++ standards committee and has been a major contributor to modern C++.

Current C++ Standard

“C++ current version” is synonymous with current “C++ standard”. The first edition of the ISO standard was “ISO/IEC 14882:1998”. The current C++ standard is C++20, or officially as ISO/IEC 14882:2020 2 and was published in December 2020. C++20 is the sixth edition of the ISO/IEC 14882. Once C++23 standard is completed it will replace the C++20 standard (ISO/IEC 14882:2020) and will be the seventh edition of the C++ standard. C++23 will likely be completed by December 2023.

One can get their own official copy for about $230. Why does the C++ standard cost money? The development, publishing, and maintaining ISO standards costs money, and selling the copies helps cover costs.

Once the official standard is released, then up to compiler vendors (e.g., GNU, Microsoft), to implement the standard into their compilers (e.g., GCC (GNU Compiler Collection) and MSVC (Microsoft Visual C++)).

The ISO group additionally publishes TRs (technical reports) and TSes (technical specifications). A technical specification (TS) decouples new features from the standard, and allows compilers to implement them as std::experimental for developers to use early.

The ISO/IEC 14882 document specifies requirements for implementations of the C++ programming language. 3. The document is generally not written for the typical developer to use as reference. However, it does provide an official document that developers often point to clarify how the language is suppose to behave. A better and more approachable C++ language reference would be Bjarne Stroustrup’s “The C++ Programming Language”.

Timeline

Year Milestone Notable Changes
1985 The C++ Programming Language, 1st edition 4 Written by Bjarne Stroustrup
1991 The C++ Programming Language, 2nd edition 5 Written by Bjarne Stroustrup
1998 C++98 First C++ ISO standard
2003 C++03 Improvements / fixes
2011 C++11 Major revision
2014 C++14 Improvements / fixes
2017 C++17 Major revision
2020 C++20 Current version
2023 C++23 Next version / In draft

Which Standard Should I pick?

A good place to start is the default standard version picked by the compiler. The default choice leaves the decision to what the compiler thinks is the best to select, likely will be the stable standard. If picking an explicit version, consider starting from C++11 or C++17 and see which features are needed. C++11 was the second major revision by the ISO committee which brought in a lot of new modern features.

In general, it depends on the type of programming that will be done. Newer versions of C++ standard will have more features which make development in C++ more approachable. However, using the standard libraries without understanding how the implementation works might make the application (relatively) slower if performance is critical.

How to select C++ Standard

Visual Studio

Microsoft Visual Studio 2022 supports ISO C++14 Standard, ISO C++17 Standard, and ISO C++20 Standard. MSVS also has a preview of the latest C++ Working Draft. In VS 2022, the default its C++ Language Standard (Project properties –> Configuration Properties –> General) to ISO C++14 Standard.

GCC

C++17 is the default mode since GCC 11 (released 4/27/2021). GCC can switch its standard by using the command-line option std=. For example, -std=c++17 would explicitly enable C++17 standard in GCC 11. C++23 features are available in GCC 11 but is experimental as the standard is not finalized yet. 6.

Determine Version of C++ standard

C++ has predefined macro __cplusplus which is the version of the C++ standard that is being used:

Standard Version
Until C++11 199711L
C++11 201103L
C++14 201402L
C++17 201703L
C++20 202002L
C++23 202302L

Code to determine compiler’s version of standard:

// for Visual Studio must enable compiler flag: /Zc:__cplusplus
void outputVersion()
{
    using namespace std;

    constexpr long pre98 = 1;
    constexpr long cpp98 = 199711L;
    constexpr long cpp11 = 201103L;
    constexpr long cpp14 = 201402L;
    constexpr long cpp17 = 201703L;
    constexpr long cpp20 = 202002L;
    constexpr long cpp23 = 202302L;

    if (__cplusplus == cpp23)
        cout << "C++23";
    else if (__cplusplus == cpp20)
        cout << "C++20";
    else if (__cplusplus == cpp17)
        cout << "C++17";
    else if (__cplusplus == cpp14)
        cout << "C++14";
    else if (__cplusplus == cpp11)
        cout << "C++11";
    else if (__cplusplus == cpp98)
        cout << "C++98";
    else if (__cplusplus == pre98)
        cout << "pre-C++98";
    else
        cout << "Unknown C++";
    cout << " (" << __cplusplus << ")" << endl;
}