logoalt Hacker News

jstimpfletoday at 9:52 AM1 replyview on HN

Well that's a lie. I've long been back to raw pointers and it's by far the easiest way to do it. All of Pimpl, unique_ptr, and whatever other clever mechanism (I'm not even looking at std::indirect anymore) just aren't really ergonomic.

Nobody needs "deep copying", ever. It's not even well defined what it should mean (i.e. how deep etc.). It's purely a theoretical problem with no good practical (one-fits-all) solution. The only practical way is to copy what you need copied, when you need it. Done.


Replies

bluGilltoday at 12:59 PM

Easiest way to make a silly mistake and have your program break from memory safety errors.

show 1 reply