C++ History and Versions

The story of C++ is the story of making C better for big programs.

Short timeline

YearEvent
1979Bjarne Stroustrup starts “C with Classes” at Bell Labs
1983The name is changed to C++ (the ++ is the increment operator of C)
1985First commercial release and the book “The C++ Programming Language”
1998First ISO standard: C++98
2011C++11: the “modern C++” starts
2020C++20: a very big update
2023C++23: the newest published standard

What the standards added

StandardImportant features
C++98 / C++03Classes, templates, exceptions, STL, namespaces
C++11auto, lambdas, nullptr, move semantics, smart pointers, range for, constexpr, threads
C++14Generic lambdas, make_unique, small fixes
C++17Structured bindings, std::optional, std::variant, std::string_view, if constexpr, filesystem
C++20Concepts, ranges, modules, coroutines, std::format, spaceship operator <=>
C++23std::print, std::expected, std::mdspan, deducing this

Which standard do you use?

You tell the compiler with a flag. All these were tested with the real compiler:

Terminal

$ g++ -std=c++23 –version | head -1
g++ (GCC) 16.2.0
$ echo 'int main() { auto f = [](auto x) { return x; }; return f(0); }' > t.cpp
$ g++ -std=c++11 t.cpp -o t11 2>&1 | head -3
t.cpp: In function 'int main()':
t.cpp:1:26: error: use of 'auto' in lambda parameter declaration only available with '-std=c++14' or '-std=gnu++14'
1 | int main() { auto f = [](auto x) { return x; }; return f(0); }
$ g++ -std=c++14 t.cpp -o t14 && echo "generic lambda works in C++14"
generic lambda works in C++14

In C++11 the generic lambda (auto x) is not allowed, and the compiler complains. In C++14 and newer it works.

Note: Learn modern C++ (C++17 and newer) from the start. It is safer and shorter than old style C++ code. Next: C++ Features.

Congratulations! Chapter Finished. Learn more about the similar topics:
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.