[omniORB] T_var in an STL Container

Ken Feuerman kfeuerma@Adobe.COM
Thu, 09 Mar 2000 10:48:30 -0800


At 01:31 PM 3/9/00 -0500, Stefan Seefeld wrote:
>Ken Feuerman wrote:
>> 
[...]
>> question is:  Do the _var mappings follow "copy semantics"?
>
>yes, _var to _var works fine. All you need to care about is to call
>_duplicate() when initializing the first _var from a _ptr.
>
>Regards,	Stefan
>_______________________________________________________              
>              
>Stefan Seefeld
>Departement de Physique
>Universite de Montreal
>email: seefelds@magellan.umontreal.ca
>
>_______________________________________________________
>
>      ...ich hab' noch einen Koffer in Berlin...
>
>
>

Thanks!  But now your comment about _duplicate() worries me.  I think if I
have a function

T_ptr GetATObj();

then the following code should be correct without leaking T resources:

{
    T_var myTObj = GetATobj();
} // myTObj leaves scope, releasing the T proxy

Are you saying that this should be

{
    T_var myTObj = T::_duplicate(GetATobj());
}

instead?

--Ken Feuerman.
Adobe Systems, Inc.