Why std::flat_set etc. lack of the merge support?
I don’t understand why std::flat_set etc. lack merge member functions. There’s already a perfect algo for implementing it — std::ranges::merge
. And I know that while de jure time complexity is supposed to be the same, de facto we get an overhead for copying/moving objects instead of simple repointings. And still, that could’ve preserved API (afak, the same motivation was for having dummy std::unordered_container::merge()
to simplify profiling checks). Now that the API’s broken, and every appearance of smth.merge()
has to be handled in some way (have a question about that too below), we can’t simply switch to flat versions.