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 is a list and their release dates.
C++
Comment
Pre
First "C with classes" version
C++
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
Important update
C++20
Important 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 C’sstdio.hlibrary.
C++03 (2003)
- Standard Library Update: Improvements to STL containers and functions to optimize their performance and stability.
- Template Stability: The implementation of templates was improved, solving limitations found after their use in C++98.
C++11 (2011)
- Auto and
decltype: Allow automatic deduction of variable types, facilitating code writing and maintenance. - Lambdas and Anonymous Functions: Introduction of lambda functions, which allow defining inline functions, 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::threadand other concurrency tools likemutex. - Uniform Initialization: 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 problems.
C++14 (2014)
- Lambda Improvements: 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, which makes the code cleaner and allows for greater flexibility.
std::make_unique: New function to facilitate the creation ofstd::unique_ptrwithout needing to explicitly specify the type.constexprImprovements: Expansion ofconstexprto 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
iforswitchstatement. - Parallel STL: Introduction of parallel operations in STL algorithms, optimizing performance in multithreaded applications.
- New Memory Control Tools: With
std::bytefor low-level byte manipulation andstd::string_viewfor working with substrings efficiently. filesystemLibrary: New library for handling files and directories in a direct and standard way.
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 data sequences and collections, simplifying code. - Coroutines: Introduction of coroutines to facilitate asynchronous and cooperative programming.
- Modules: Alternative to traditional header files, which improves compilation time and better organizes code.
std::format: New library for formatting strings, similar toprintfbut more flexible and safe.- Integrated Namespaces (
namespace): Support for nested namespaces that simplifies code organization and readability.
C++23 (2023)
- Expansion of
std::expected: Introduction ofstd::expectedto manage returns that may fail, offering an alternative to exceptions. - Coroutine Continuation: Improved support for coroutines to simplify the handling of asynchronous functions.
- Module Improvements: Refinements to the module system introduced in C++20, making it more flexible and optimized.
- Greater Integration with
constexpr: Newconstexprcapabilities that allow evaluating more types of functions and expressions at compile time. - Compatibility with Safer Type Systems: Includes more type safety in the standard library and improves interoperability with modern languages.
