Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-07-15 15:22:03


Daniel Frey wrote:
>
> To explain the bug a bit: When you create a small test case, you'll
> probably get the error from the compiler you are looking for. If you
> put
> the checked_delete in it's own header, it still works as long as you
> include the header with
>
> #include "my_header.h"
>
> but if you use
>
> #include <my_header.h>
>
> and compile it with -I. then the compiler magically accepts
> sizeof(Incomplete) with no warnings or errors and returns 0 as the
> size.

Looks like a "feature" to me. Apparently some important system header does
sizeof(incomplete).

> To work around this, I added a simple STATIC_ASSERT which - for some
> reason - still works :)

Odd, since the Intel-specific BOOST_STATIC_ASSERT is

#elif defined(BOOST_INTEL_CXX_VERSION)
// agurt 15/sep/02: a special care is needed to force Intel C++ issue an
error
// instead of warning in case of failure
# define BOOST_STATIC_ASSERT( B ) \
    typedef char BOOST_JOIN(boost_static_assert_typedef_, __LINE__) \
        [ ::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >::value ]

which looks pretty close to what checked_delete uses.

> +#include <boost/config.hpp>
> +#if defined(BOOST_INTEL)
> +#include <boost/static_assert.hpp>
> +#endif

Dependencies. I hate dependencies.


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