Crumsort and Quadsort in C++
github.com·10h·
Discuss: r/cpp
Flag this post

Crumsort and Quadsort in C++

This is a lightning fast C++17 port of Igor van den Hoven’s crumsort and quadsort.

Porting crumsort and quadsort to C++ is not as trivial as one might expect. The original crumsort and quadsort have many C-isms that don’t map well to modern C++:

  • They take raw pointers as input, not random access iterators. That means they only work for arrays of contiguous memory, like std::vector, and not on discontiguous containers, like std::deque.
  • They use C99 variable length arrays, which are not part of the C++ standard. Some C++ compilers support VLAs as a language extension, but others (MSVC) do not.
  • They assume that that the sorted type is [trivial](https://en.cppref…

Similar Posts

Loading similar posts...