This repo implements radix sort as a sup::sort() function, which takes the beginning and end iterator of a container which you want to sort.
This works as a drop-in replacement for the std::sort() available in the STL,
but works significantly faster
for large containers.
This function works for all signed and unsigned integral types (for e.g: int, long long, unsigned int etc.).
The function is defined in the radix_sort.hpp
file.
Concepts were introduced in C++20 and in this project they're used to ensure that the types of the iterators passed to sup::sort() are
random access and point to values of integral type.
If some of these requirements fail, you'll get a compile-time error.
compile time tests as well as performance testing is defined in the tests.cpp
file.
Min C++ version: 20 (check that your compiler version supports concepts.)
required standard library includes: vector, array, concepts, type_traits
Recommended g++ compiler flags:
-std=c++23
-O3
-fconcepts-diagnostics-depth=5
NOTE: It is possible that depending on your compiler and development environment you'll have to define additional compiler flags or tasks in your IDE/editor.
For example, on VSCode with GCC, you might have to define a c_cpp_properties.json
file in your .vscode/
folder with additional config information for concepts to work correctly