Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2002-10-23 08:49:17

Here's an implementation that works with Comeau C/C++, Intel C++ 6.0
and, surprisingly, MSVC 6.5 (after getting rid of partial specialization, of
course; not shown here):

    #include "boost/static_assert.hpp"
    #include "boost/config.hpp"

    template< typename T, int >
    struct identity_if
        typedef T type;

    template< typename T >
    struct identity_if<T,0>

    template< typename T, typename = T>
    struct is_incomplete
        BOOST_STATIC_CONSTANT(bool, value = true);

    template< typename T >
    struct is_incomplete<
        , typename identity_if< T, sizeof(T) >::type
        BOOST_STATIC_CONSTANT(bool, value = false);

    union U {};
    class C {};
    struct S {};

    union incomplete_U;
    class incomplete_C;
    struct incomplete_S;



Boost list run by bdawes at, gregod at, cpdaniel at, john at