Boost logo

Boost :

Subject: Re: [boost] Curiousity question
From: Edward Diener (eldiener_at_[hidden])
Date: 2016-10-12 20:24:01


On 10/12/2016 8:06 PM, Gavin Lambert wrote:
> On 13/10/2016 11:58, Edward Diener wrote:
>> I would like to ask a design question for any Boost developers or anyone
>> on this mailing list who might care to answer.
>>
>> You are designing or working on a library, perhaps for Boost, perhaps
>> for fun, and part of the design of the library has some public
>> functionality taking a shared pointer as input. You:
>>
>> 1) Use boost::shared_ptr
>> 2) Use std::shared_ptr
>> 3) Use both boost::shared_ptr and std::shared_ptr with the same
>> functionality
>> 4) Use neither, you roll your own shared pointer-like functionality
>> 5) You don't lke shared pointers and use raw pointers instead
>>
>> I really am curious about this. I haven't put any limitation on your
>> library or made any presumption on who your library is for, on purpose.
>
> If I'm writing a small library/program that doesn't need Boost for
> something else, then I'll use std::shared_ptr.

Are you assuming that programmers using your small library compiler with
c++11 support ?

>
> Otherwise, I'll use boost::shared_ptr, except where required to use
> std::shared_ptr by existing interfaces.

So if existing interfaces already used std::shared_ptr you'd keep them
like that, else for any new shared pointer interfaces you would use
boost::shared_ptr ?
>
> (Why? Because boost::shared_ptr is better. It has shared_from_raw and
> a few other such convenience features.)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk