Let’s review the main versions of C++, along with their most important improvements and modifications.
C++ has evolved considerably since its creation, adapting to new challenges and trends in software development.
So here you have a list and its release date.
C++
Comment
Pre
First version "C with classes"
C++
Object-oriented programming added
C++1.0
Commercial version
C++98
First ISO standard
C++03
Error corrections
C++11
Major update
C++14
Minor improvements
C++17
Significant update
C++20
Significant update
C++23
Simplification and improvements
C++26
(in development)
Features by version
C++98 (1998)
C++98 was the first official standardization of C++ by the International Organization for Standardization (ISO).
- Introduction of the Standard Library (STL): Included containers and algorithms in the STL, such as
vector
,map
,set
,list
, etc., which allowed for greater efficiency and ease of use in data manipulation. - Templates and Exceptions: Improved support for generic programming through templates, as well as handling exceptions (
try
,catch
,throw
). - Input and Output with Streams: Introduction of the stream system (
iostream
) for data input and output instead of thestdio.h
library from C.
C++03 (2003)
- Standard Library Update: Improvements in containers and functions of the STL to optimize performance and stability.
- Template Stability: Improved implementation of templates, resolving limitations encountered after their use in C++98.
C++11 (2011)
- Auto and
decltype
: Allow automatic type deduction of variables, making code writing and maintenance easier. - Lambdas and Anonymous Functions: Introduction of lambda functions, which allow defining functions inline, useful for functional programming and reducing repetitive code.
- Move Semantics and Rvalue References: Introduction of move semantics to optimize memory management, especially in copy and assignment operations.
- Multithreading with
std::thread
: Support for concurrent and multithreaded programming throughstd::thread
and other concurrency tools likemutex
. - Uniform Initialization: A new way to initialize variables and containers more intuitively and without ambiguity.
- Smart Pointers (
std::unique_ptr
,std::shared_ptr
): Smart pointers that help manage memory automatically, reducing memory leak issues.
C++14 (2014)
- Improvements in Lambdas: Ability to capture variables by move, allowing greater control over data usage in lambda functions.
- Return Type Deduction: Deduction of the return type in functions, making the code cleaner and allowing for greater flexibility.
std::make_unique
: New function to facilitate the creation ofstd::unique_ptr
without needing to specify the type explicitly.- Improvements in
constexpr
: Expansion ofconstexpr
to evaluate more expressions at compile time.
C++17 (2017)
std::optional
,std::variant
, andstd::any
: New types that simplify the management of optional values (optional
), data types with multiple options (variant
), and dynamically typed variables (any
).- If and Switch with Initializers: Allows declaring and assigning variables in the same line as an
if
orswitch
statement. - Parallel STL: Introduction of parallel operations in STL algorithms, optimizing performance in multithreaded applications.
- New Tools for Memory Management: With
std::byte
for low-level byte manipulation andstd::string_view
for efficient substring handling. filesystem
Library: A new library for handling files and directories directly and standardly.
C++20 (2020)
- Concepts: Allow defining constraints for data types in templates, improving clarity and control in generic programming.
- Ranges (
ranges
): Facilitates the manipulation of sequences and collections of data, simplifying code. - Coroutines: Introduction of coroutines to facilitate asynchronous and cooperative programming.
- Modules: An alternative to traditional header files, improving compilation time and better organizing code.
std::format
: New library for formatting strings, similar toprintf
but more flexible and safe.- Integrated Namespaces (
namespace
): Support for nested namespaces that simplifies organization and readability of code.
C++23 (2023)
- Expansion of
std::expected
: Introduction ofstd::expected
for managing returns that can fail, offering an alternative to exceptions. - Continuation in coroutines: Improvement in coroutine support to simplify handling asynchronous functions.
- Improvements in modules: Refinements in the module system introduced in C++20, making it more flexible and optimized.
- Greater integration with
constexpr
: New capabilities ofconstexpr
that allow evaluating more types of functions and expressions at compile time. - Compatibility with safer type systems: Includes more safety types in the standard library and improves interoperability with modern languages.