Boost logo

Boost Users :

Subject: Re: [Boost-users] Does shared_ptr support interface pointers without a virtual destructor
From: Ben Pope (benpope81_at_[hidden])
Date: 2014-12-15 09:13:46

On Monday, December 15, 2014 04:31 AM, John Selbie wrote:
> What is the general guidance with using shared_ptr on interfaces that do
> not have virtual destructor?

"[This constructor is a template in order to remember the actual pointer
type passed. The destructor will call delete with the same pointer,
complete with its original type, even when T does not have a virtual
destructor, or is void]"

You should also be good with make_shared, which is preferred.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at