From: degski (degski_at_[hidden])
Date: 2019-06-28 10:08:19
On Fri, 28 Jun 2019 at 11:38, Andrey Semashev via Boost <
> Most C-style APIs follow the new/delete
> pattern, where you have a function that allocates and initializes a
> structure, returning a pointer to it, and another one to free it, along
> with any associated resources.
Doesn't sound like overkill to me, now I have no dependency and I can add
details at will [without reading any docs].
> Using a smart pointer to store a pointer
> to that structure is perfectly valid, and the easiest and most natural
> thing to do.
Right, most natural since C++11 that is then.
> And using a smart pointer to
> manage that resource is perfectly adequate.
It's the "if-I-have-a-hammer-everything-looks-like-a-nail-syndrom".
-- @realdegski https://edition.cnn.com/interactive/2019/06/middleeast/saudi-teen-death-penalty-intl/ "Anyone who believes that exponential growth can go on forever in a finite world is either a madman or an economist" - Kenneth E. Boulding
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk