
18 Mar
2011
18 Mar
'11
11 p.m.
AMDG On 03/18/2011 03:47 PM, Emil Dotchevski wrote:
On Fri, Mar 18, 2011 at 12:33 PM, Ted Byers
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