Crumsort and Quadsort in C++
github.com·12w·
Discuss: r/cpp

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

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help