Ziggit

Why does `std.mem.sort` have the `context` field? (opens in new tab)

TL;DR Why does std.mem.sort take in a context structure? I’ve only used Rust, Julia, Python and OCaml and their sort implementations don’t do that. This seems like (to me, who’s not a very good programmer) a strange thing a standard library sort function to have? The other languages I know don’t have that, but I did learn that libc has it, which makes me think there’s a common use case for this that I’m unaware of. Could somebody point me in the right direction to learn why this is such a com...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help