Subject: Re: [boost] is_base_of: bug in trunk, not in sandbox
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2011-03-16 09:12:40


2011/3/10 Steven Watanabe <watanabesj_at_[hidden]>

> Thanks to Christopher Jefferson, I discovered a bug in the trunk (in
>> fact in 1.46.0) for is_base_of in the type_traits library.
>>
>> is_base_of<int, int>::value should be true according to the doc:
>> "is_base_of<Base, Base>::value is an integral constant expression that
>> evaluates to true: a class is regarded as it's own base.
>>
>
> On 03/10/2011 04:54 AM, Frédéric Bron wrote:
> int is not a class.
>

Hello,

I am about to use is_base_of, and remembered this discussion, so I looked
into the docs. From 1.45.0 docs:

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. This is a change in behaviour from
Boost-1.33 in order to track the Technical Report on C++ Library Extensions.

I understand, that this means is_base_of<int,int> should be true.

Has this changed in 1.46.0, or are the docs wrong?

Regards,
Kris.