Let’s review the main versions of C++, 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 dates.
C++
Comment
Pre
First version "C with classes"
C++
Object-oriented programming (OOP) added
C++1.0
Commercial version
C++98
First ISO standard
C++03
Bug fixes
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 exception handling (
try
,catch
,throw
). - Input and Output with Streams: Introduction of the stream system (
iostream
) for data input and output instead of the C librarystdio.h
.
C++03 (2003)
- Standard Library Update: Improvements in containers and STL functions to optimize their performance and stability.
- Template Stability: Improved the implementation of templates, resolving limitations encountered after their use in C++98.
C++11 (2011)
- Auto and
decltype
: Allow automatic type deduction of variables, facilitating code writing and maintenance. - 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 Memory Management Tools: With
std::byte
for low-level byte manipulation andstd::string_view
for efficiently working with substrings. filesystem
Library: New library to handle files and directories directly and in a standardized way.
C++20 (2020)
- Concepts: Allow defining constraints for data types in templates, improving clarity and control in generic programming.
- Ranges: Simplifies the manipulation of sequences and collections of data, streamlining code.
- Coroutines: Introduction of coroutines to facilitate asynchronous and cooperative programming.
- Modules: Alternative to traditional header files, improving compile time and organizing code better.
std::format
: New library for formatting strings, similar toprintf
but more flexible and safe.- Integrated
namespace
: Support for nested namespaces that simplify code organization and readability.
C++23 (2023)
- Expansion of
std::expected
: Introduction ofstd::expected
to manage returns that may fail, offering an alternative to exceptions. - Continuation in coroutines: Improvement in coroutine support to simplify the handling of asynchronous functions.
- Improvements in modules: Refinements in the module system introduced in C++20, making it more flexible and optimized.
- Greater integration with
constexpr
: Newconstexpr
capabilities 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.