|
Boost : |
Subject: Re: [boost] Looking for thoughts on a new smart pointer: shared_ptr_nonnull
From: Jeff Flinn (jeffrey.flinn_at_[hidden])
Date: 2013-10-03 14:07:21
On 10/3/2013 1:18 PM, Thorsten Ottosen wrote:
> On 03-10-2013 19:04, Andrey Semashev wrote:
>> On Thursday 03 October 2013 18:37:45 Thorsten Ottosen wrote:
>
>>>
>>> with use like
>>>
>>>
>>> shared_obj<Foo> sharedFoo = make_shared_obj( 42, "foo" );
>>>
>>> would be good names.
>>
>> I agree, this is a good alternative. Although why not immediately this:
>>
>> shared_obj<Foo> sharedFoo( 42, "foo" );
>>
>
> Seems good. As long as it implements the "allocate counts and object in
> one allocation".
And now there's no pointer argument with preconditions to worry about,
and no issue with pointer/bool conversion since it's not a pointer.
Jeff
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk