Boost logo

Boost :

Subject: Re: [boost] [type_traits] is_base_of<> GCC error for v1.42.0
From: John Maddock (boost.regex_at_[hidden])
Date: 2010-05-09 05:04:46


>The following code gives the GCC compiler error below for Boost 1.42.0
>while it compiles just fine for Boost 1.34.1.
>
>Is this a bug in Boost.TypeTraits for 1.42.0?

No it's a feature... sort of.

Part of the requirements on the template parameters for is_base_of are that
they are complete types, if they're not complete types then our
implementation can silently do the wrong thing, so we assert that they are
complete inside the implementation. The change was introduced as a bug fix
to another issue, and simply asserts what we have always documented, so I'm
afraid you're out of luck in that particular use case :-(

The same applies to std::is_base_of I believe as well.

The only workaround I can think of would be to forward declare the two
classes and then specialize is_base_of for that use case.

HTH, John.


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