Skip to content

DrEverr/c-cpp

Repository files navigation

C++20 Algorithms

This repository contains example algorithms that demonstrate the use of the newest features in C++20.

Features

  • Concepts
  • Ranges
  • Coroutines
  • Calendar and Time Zone Library
  • Improved constexpr
  • Modules
  • Three-way Comparison (Spaceship Operator)

Getting Started

To compile and run the examples, you will need a C++20 compatible compiler such as GCC 10+, Clang 10+, or MSVC 2019.

Compiling

gcc -std=c++20 -o {output_name} {file_name}.cpp

for current_time I recommend to use the following command:

gcc -std=c++20 -o current_time current_time.cpp -lstdc++

Examples

  • 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.

Contributing

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.

License

This project is licensed under the MIT License.

Acknowledgements

  • The C++ Standards Committee for their continuous work on improving the language.
  • Contributors to the C++20 standard and its implementation in various compilers.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published