Boost logo

Boost :

Subject: Re: [boost] temp_ptr<> - preventing use as a member
From: Gottlob Frege (gottlobfrege_at_[hidden])
Date: 2011-11-17 19:53:26


On Thu, Nov 17, 2011 at 1:37 AM, Gottlob Frege <gottlobfrege_at_[hidden]> wrote:
>
> Yep.  The tradeoff is
> int func(temp_ptr<Foo> & foo)
>
> not a big deal maybe, but it might be if my audience already is
> uncomfortable with references vs pointers vs smart-ptrs (ie ex-java).
> Throw a const or two in there and heads explode.  Maybe the whole idea
> is a non-starter.  But I do wonder what code with all smart-ptrs would
> look like.  Of course if I had to templatize all my, say, image
> processing, because the pixel could be a temp_ptr<Pixel>,
> some_other_ptr<Pixel>,... instead of just Pixel *, that might be
> annoying...
>
> Tony
>

To clarify, I want to see if it is possible to reasonably avoid
pointers (and references), since they don't specify their lifetime
contract. So I'd prefer not to have to pass the wrappers as pointers
or references. :-)

Tony


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