$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: d_zakaib (d_zakaib_at_[hidden])
Date: 2003-05-06 02:18:07
--- In Boost-Users_at_[hidden], "Lehrer, Joshua" <boost_at_l...>
wrote:
> WRT boost::shared_ptr<>, why not template the explicit constructor
> that takes a T*? This way, it could select the correct destructor
> at construction time:
>
> struct base { ~base(); };
> struct sub : public base { ~sub() };
> boost::shared_ptr<base>(new sub);
>
> The above code currently only calls ~base(); Templating the
> explicit single argument constructor would allow the above code to
> call ~sub().
>
Why not just have a virtual destructor? Then delete will be able to
destroy your derived class properly:
struct base { virtual ~base(); };
Dan