Boost logo

Boost Users :

Subject: Re: [Boost-users] [Interprocess] shared_ptr in shared memory and inheritance
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2009-02-09 16:01:32


Emil Dotchevski wrote:
> You're probably doing something wrong, shared_ptr doesn't require
> virtual destructor to call the correct destructor. Here is a working
> example: http://codepad.org/sktELTDk

Yes, it needs a virtual destructor if it's a shared_ptr to the base
class, otherwise you can't achieve type erasure. This virtual call does
not happen with boost::interprocess::shared_ptr because virtuality is
forbidden in shared memory.

Regards,

Ion


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net