[C++-sig] Newcomer - constructors not working as I'd expect

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Tue Apr 11 01:54:19 CEST 2006


--- Andrew Pontzen <app26 at ast.cam.ac.uk> wrote:
> I agree it's not ideal. However, in the case of my current project, I 
> don't really see a way of avoiding keeping hold of the reference.
> Of course in the real code, I'll be using a policy! (Is there any 
> particular reason why using boost::shared_ptr would be preferable to using 
> a policy?

I find using shared_ptr easier than figuring out which one is the right call
policy.

> I'd rather avoid adding support for shared_ptr through my 
> existing code if possible, but am unsure if it might have any advantages.)

With shared_ptr your C++ code is also safe, not just the Python interface.

Cheers,
        Ralf


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Cplusplus-sig mailing list