News for hackers. Stuff that matters.
Re:Modern C++ – RAII by ninkendo on Friday May 30, 2025 @08:59AM (#44135781)
C++17 has copy elision as part of the standard now, so you can be guaranteed of the scenarios where C++ is required to outright skip the copy/move/destruction, leaving no code paths left for any refcounts. It’s not everything, there’s still plenty of optimizations on the table, but copy elision should eliminate a ton of refcount bookkeeping.
Re:Modern C++ – RAII by pjmlp on Friday May 30, 2025 @11:25AM (#44137149)
In some scenarios, there is a reason why there a few conference talks on the gotchas regarding that, especially when coupled with RVO.