Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-04-04 14:10:49


FWIW, this code:

#include <boost/smart_ptr.hpp>

class X;

int main()
{
 boost::scoped_ptr<X> p;
 return 0;
}

gives

MSVC 7.0: "warning C4150: deletion of pointer to incomplete type 'X'; no
destructor called" (BTW config.hpp is overoptimistic);

bcc32 5.5.1: "Warning W8073 C:\Projects\Include\boost/smart_ptr.hpp 74:
Undefined structure 'X' in function scoped_ptr<X>::~scoped_ptr()";

g++ 2.95.2: "\projects\include\boost\smart_ptr.hpp:74: invalid use of
undefined type `class X'" (an error!)

Comeau Online: "13526.c", line 5: warning: delete of pointer to incomplete
class

So it's not that bad. Unfortunately, Intel C++ 5.0 gives no warning
(config.hpp is incorrect on this one too - it needs to check _CPPLIB_VER
since ICL shares its stdlib with MSVC.)

--
Peter Dimov
Multi Media Ltd.

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