|
Boost : |
From: Seweryn Habdank-Wojewódzki (shw_at_[hidden])
Date: 2007-09-24 13:26:58
Hi
Thanks for the reply.
> I'm not sure if it's clear from the docs, but the behaviour of is_base_of
> was changed in the draft std so that it evaluates to true for any
> is_base_of<T,T>.
No. This is not clear :-).
> So if you want to assert that B really is a base class of
> R, then use:
>
> is_base_of<B,R>::value && !is_same<B,R>
>
> or
>
> is_base_of<B,R>::value && is_class<B>::value
I know that solution, but the more important is that there is difference
between that two cases. Theoretically both codes have to generate the same
result. Because they are working on the same types.
There have to be no difference in the assertions -- failed or not, but
assertions have to be the same.
> Ah, just checked the docs, and it does say: " Note that is_base_of<X,X> will
> always inherit from true_type. This is the case even if X is not a class
> type.
Yes. That was the base of the question.
> This is a change in behaviour from Boost-1.33 in order to track the
> Technical Report on C++ Library Extensions."
OK. Thanks.
Best regards.
-- |\/\/| Seweryn Habdank-Wojewódzki \/\/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk