[C++-sig] Re: Call Policy Question
dave at boost-consulting.com
Thu Nov 4 15:01:17 CET 2004
Mike Thompson <mike.spam.filter at day8.com.au> writes:
> I have a member function which returns an object and I'm trying to
> define a call policy for that member function which will:
> 1. cause the returned object to be managed:
> its a new object and needs to be managed.
> 2. register that the returned object holds a
> reference to the originating object (but not visa-versa)
> but I can't work out how to combine the two.
> I need 1. above because the returned object is new and needs to be managed.
> I need 2. above because this returned object has references BACK
> to the object who's member function supplies it.
> So the returned object can be destroyed without the original being
> effected, but destruction of the original MUST wait until the returned
> object is gone.
, with_custodian_and_ward<0, 1>
More information about the Cplusplus-sig