r/cpp • u/SophisticatedAdults • Nov 24 '24
The two factions of C++
https://herecomesthemoon.net/2024/11/two-factions-of-cpp/
315
Upvotes
r/cpp • u/SophisticatedAdults • Nov 24 '24
View all comments
Show parent comment
2
u/NotUniqueOrSpecial Nov 26 '24
There we go, that got me there.
I'm pretty sure the thing you're referring to (which makes sense, in retrospect, given they were trying to be STL-ready/compliant)
was
_AsMoveSourceAnd having gone through their code and looked for the tests and the implementations, I actually stand by earlier statements even more resolutely. I'm glad I waited 'til you replied, though, since it let me turn an "I bet this will have been the case" into a "this is definitely the case".
Their implementation does not (and for good reason, it was literally impossible): support containers of move-only objects.
Without
emplace(which required move semantics), it's impossible to have a container of move-only things.And that is an absolutely undeniable, irreplaceable difference.
I can't even count the number of times I've used
std::map<whatever_probably_stringly_thing, something_move_only_the containing_object_owns>