This repository contains example algorithms that demonstrate the use of the newest features in C++20.
- Concepts
- Ranges
- Coroutines
- Calendar and Time Zone Library
- Improved constexpr
- Modules
- Three-way Comparison (Spaceship Operator)
To compile and run the examples, you will need a C++20 compatible compiler such as GCC 10+, Clang 10+, or MSVC 2019.
gcc -std=c++20 -o {output_name} {file_name}.cppfor current_time I recommend to use the following command:
gcc -std=c++20 -o current_time current_time.cpp -lstdc++- Concepts: Demonstrates the use of concepts to specify template requirements.
- Ranges: Shows how to use the new ranges library for more expressive and readable code.
- Coroutines: Example of asynchronous programming using coroutines.
- Calendar and Time Zone: Utilizes the new calendar and time zone library for date and time manipulation.
- Constexpr: Improved constexpr capabilities for compile-time computation.
- Modules: Example of modular programming in C++20.
- Three-way Comparison: Demonstrates the use of the spaceship operator for comparisons.
Feel free to fork this repository and contribute by submitting pull requests. Please ensure that your code adheres to the C++20 standard and includes comments for clarity.
This project is licensed under the MIT License.
- The C++ Standards Committee for their continuous work on improving the language.
- Contributors to the C++20 standard and its implementation in various compilers.