A generic C++17 header-only library providing sorting algorithms, sorter adapters, and related tools with a unified interface.
cpp-sort is a generic C++17 header-only library that provides a collection of sorting algorithms and related utilities through a unified interface. It solves the problem of needing multiple sorting strategies by offering sorters, adapters, and tools that can be combined to handle different data structures, performance requirements, and disorder characteristics efficiently.
C++ developers who need flexible, high-performance sorting beyond the standard library, particularly those working with custom data structures, proxy iterators, or requiring adaptive sorting behavior.
Developers choose cpp-sort for its extensive algorithm selection, composable adapters, and modern C++ features like projections and proxy iterator support, which allow for optimized sorting tailored to specific use cases without sacrificing a clean API.
Sorting algorithms & related tools for C++
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers numerous sorting algorithms like smooth sort, Timsort, and pattern-defeating quicksort, allowing developers to pick the best fit for specific data characteristics and performance needs.
Provides wrappers such as drop_merge_adapter and split_adapter that can make base sorters adaptive to existing disorder in data, enhancing efficiency without algorithm modifications.
Supports projections for sorting by member or computed values, handles proxy iterators correctly, and offers both range and iterator interfaces, ensuring compatibility with custom types and STL-like code.
As a header-only library, it's easy to add to projects without complex build system dependencies, though it may increase compile times in large codebases.
Requires C++17 and has limited support for some compilers like older MSVC versions, with certain features unavailable, as admitted in the README's compiler support section.
Being header-only, including multiple sorters and adapters can significantly increase compilation times, which might be problematic for projects with strict build performance requirements.
The plethora of sorters, adapters, and utilities requires deep understanding to compose effectively, making it less accessible for quick or simple sorting tasks compared to std::sort.