----- Original Message -----
From: "Peter Dimov" <[EMAIL PROTECTED]>
To: "Boost mailing list" <[EMAIL PROTECTED]>
Sent: Tuesday, December 10, 2002 9:24 AM
Subject: Re: [boost] Re: Formal review: Optional library


> From: "Fernando Cacciola" <[EMAIL PROTECTED]>
> > Considering a member function that returns a pointer to something that
is
> > inside an object -a typical 'get()'-, it was noticed that most of the
> times,
> > it is not clear how the lifetime of the returned object is supposed to
be
> > handled.
> [...]
> > (b) in other cases, the object is being handed out through the pointer
and
> > there is some sort of ownership transfer or distribution involved.
>
> Example?
>
I don't know of 'standard' examples, but in my code I do that a lot:

class curve
{
  shared_ptr<polygon> acquire_approx() const { return m_approx ; }
  shared_ptr<polygon> m_approx ;
} ;

Fernando Cacciola

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to