From: John Maddock (John_Maddock_at_[hidden])
Date: 2001-06-07 05:50:50
> >Same things with scoped_ptr_example_test.cpp.
> >Is this bcb5 only bug ?
>I was able to reproduce the problem for the Borland compiler but not some
>of the others.
It looks to be a Borland bug: for some reason the destructors of all
sub-objects get instantiated when you write:
Even if T has all constructors/destructor declared but not defined.
This basically makes it impossible to implement the pimpl idon using a
smart pointer with this compiler (or any others that have the same
problem). Note that commenting out the static assert is *not* an option:
the code compiles then, but issues a warning about deleting an incomplete
type - as a result it will not behave correctly at run time - or rather it
*may* not, depending on which version or the smart_ptr's destructor makes
it into the exe (there may be different versions in different translation
units, some instantiated "prematurely", others not).
- John Maddock
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk