Boost logo

Boost :

Subject: Re: [boost] Curiousity question
From: Edward Diener (eldiener_at_[hidden])
Date: 2016-10-13 04:40:48


On 10/12/2016 10:27 PM, Gavin Lambert wrote:
> On 13/10/2016 15:04, Edward Diener wrote:
>> The end-user of your library, especially if it is meant for public
>> consumption, might find it odd <g> that some interfaces use
>> std::shared_ptr and others use boost::shared_ptr. Even more so if he is
>> using one or the other of the two consistently throughout his own usage
>> of your library in whatever executable or library he is working on. But
>> I understand why you would prefer your own way. As long as you document
>> what should be used it is easy enough for the end-user of your library
>> to adapt successfully.
>
> Typically I'll use a typedef in any public API anyway, such that
> consumers will just use FooPtr (or auto) and thus never need to type
> shared_ptr themselves.
>
> Or I'll use a handle/body pimpl idiom so that the only shared_ptrs they
> see are the single private member of the handle type, and again they
> don't need to see them.
>
> So in that regard, they shouldn't need to care which one I chose to use.

These are interesting ideas. Thanks !


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