Boost logo

Boost :

From: Daniel Frey (d.frey_at_[hidden])
Date: 2008-04-09 14:13:44


On Wed, 2008-04-09 at 13:40 -0400, Frank Mori Hess wrote:
> But *this inside enable_shared_from_this<T> is not a T*, it is a
> enable_shared_from_this<T>*. To downcast it to a T* requires a dynamic_cast
> for the general case, which requires a vtable. Not that I consider a vtable
> to be significant overhead (I know, it's a horrifiying opinion for a C++
> programmer but there it is).

static_cast<T*>(this) should be legal AFAIK (and doesn't need a vtable)

Regards, Daniel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk