Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::exception_detail::error_info_base does not have virtual destructor
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-03-18 19:00:12


AMDG

On 03/18/2011 03:47 PM, Emil Dotchevski wrote:
> On Fri, Mar 18, 2011 at 12:33 PM, Ted Byers<r.ted.byers_at_[hidden]> wrote:
>> The most useful power of runtime polymorphism is based on invokving the
>> right virtual functions through base pointers, so I don't see why it is bad
>> to use polymorphism when it comes to destruction also.
> The way shared_ptr destroys objects is also polymorphic, it just
> doesn't use virtual functions. It's actually more powerful than
> virtual functions because it doesn't need a virtual function table; as
> illustrated, even a shared_ptr<void> can destroy the object correctly.

It does use virtual functions internally,
just not virtual functions of the pointee.

In Christ,
Steven Watanabe


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