/cpp-sleep-sort

C++20 Implementation of Sleep Sort using std::thread

Primary LanguageC++MIT LicenseMIT

README.md

ci

The C++20 implementation of Sleep Sort using std::thread.

Prerequisites

The following versions or newer required.

For Windows:

  • MS Visual Studio 2022

For Ubuntu, MacOS:

  • CMake 3.22
  • GNU Make-4.3
  • C++20 compliant compiler: clang-15.0.6 or g++-11.3.0

Optional:

  • clang-format-15.0.6
  • Doxygen-1.9.1
  • Graphviz-2.43.0

Usage

  1. Generate the build system and navigate to the directory:
$ cmake -Bbuild

optoins(default):

  • BUILD_DOC(OFF): Build API Documents
  • ENABLE_FORMAT(OFF): Enable Format sources

Example:

$ cmake -DBUILD_DOC=ON -DENABLE_FORMAT=ON -Bbuild
  1. build and test:

When BUILD_DOC is ON, API document is also generated.

$ cd build
$ cmake --build . -j
$ ctest -C Debug
  1. Format sources anytime using clangformat target:

requires ENABLE_FORMAT is ON.

$ cmake --build . --target clangformat

Docker

  1. Build Docker image:
$ docker build -t sleep-sort .
  1. Run Docker container:
$ docker run --rm -it -v $PWD:/sleep-sort -w /sleep-sort sleep-sort

References

Lisence

MIT