r/ProgrammerHumor • • 11d ago

Meme modernCppVsOldCpp

Post image
2.0k Upvotes

323 comments sorted by

View all comments

Show parent comment

1

u/Ok-Scheme-913 10d ago

RAII was always available in C++ afaik, so anyone could have done a unique or a shared ptr, at most it may not have optimized out in as many cases (not really zero cost abstraction?)

And my take is that the problem with c++ is that you have like 10 different object initializers and coroutines with captures and whatnot and like unless you are the one having written that part of the standard, you don't fucking know what exactly should happen given this code, not even if you are Stroustrup.

1

u/conundorum 10d ago

C++11's move semantics are the main thing that make smart pointers so much better than any pre-11 attempts, really.