Boost logo

Boost :

From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2002-05-09 21:34:22


Hi,

Look at the following example:

#include <boost/type_traits/conversion_traits.hpp>
template<typename T>
struct A : T
{
    A() {}
    template<class T1>
    A( A<T1> const& rhs ) : T( rhs ) {}
};

struct B {};
struct C {};

int main() {
    bool bb = boost::is_convertible<A<B>,A<C> >::value; // here value bb is
true, while I expext it will be false
    return 0;
}

With MSVC 6.5 I have got incorrect value bb - true.
Why?
Is it is_convertible bug?
Is it missing feature in is_convertible implementation?
Is it bug in MSVC?
Is it impossible to implement correctly?

If it last, is there other way to perform this check.

Regards,

Gennadiy.


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