3 ms·
Let's play "who's supposed to call 'free' on this pointer"!!!
Let's play "who's supposed to call 'free' on this pointer"!!!
And which free do you call? Do you call "free", "my_free", "3rdparty_typea_free" or "3rdparty_typeb_free"?
This is why I really, really like unique_ptr. You either explicitly take responsibility (and it implicitly gets handled) or you explicitly hand it off.