Boost logo

Boost :

From: AlisdairM (alisdair.meredith_at_[hidden])
Date: 2003-12-11 04:50:28


AlisdairM <alisdair.meredith_at_[hidden]> wrote in
news:Xns944E622FC7D0Calisdairmeredithukre_at_80.91.224.252:

> Not sure this is actually useful though, as I'm sure the shared_ptr
> overhead is more than the cost of adding a virtual destructor ;¬ )

Actually I take that back. This will be useful when adapting a library
outside your control.

For instance, BCB6 finally allows multiple inheritence with VCL classes, so
long an non-VCL bases are 'interface' classes, structs of nothing but pure
virtual functions.
If you want to add a virtual destructor, you need to use a Borland
extension, the __fastcall calling convention. This trick gives a
workaround. (although the automatic destructor is public in this case)

I suspect there are many other libraries out there with similar
limitations.

AlisdairM


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