Re:Algorithms for Modern Hardware
by deadlypointer on Saturday March 16, 2024 @03:26AM
(#39723976)
Std::set is using red black trees, did you mean std unordered set?
Re:Algorithms for Modern Hardware
by anonymoushn on Saturday March 16, 2024 @05:06AM
(#39724369)
yes, the common complaint about separate chaining being effectively mandatory is about unordered_map and unordered_set. It looks like std::set suffers from essentially the same pathology though: you cannot use implementations with good data layouts (b-trees) because the standard imposes unreasonable requirements about iterator invalidation.
[dead]
Re:Algorithms for Modern Hardware
by 3836293648 on Saturday March 16, 2024 @06:08AM
(#39724609)
Because if you need something to remain in the same place you box it yourself. Ruining the performance for everyone else because you don't want to handle some boxing on your own is hardly reasonable. This goes fully against the C++ mantra of if you don't use it, you don't pay for it. It's why you have sort and stable_sort rather than unstable_sort and sort.
Just because Hyrum's Law applies to an implementation of the standard doesn't mean that you should pessimise your implementation. You should actively hurt those who rely on implementation quirks
Basically they've overspecified their datastructures and we're now paying the price