Hi there,

Should this work?

I've tried it using g++ 3.2 (redhat and cygwin) and borland c++ builder
5.6.4 and it fails on the assert for all of them.


#include <boost/type_traits.hpp>
#include <cassert>

class A {};

class B : public A {};

template <typename T>
bool isDerivedFromA(const T& t)
{
    return boost::is_base_and_derived<A, T>::value;
}

int main()
{
    B b;
    A* pa = &b;
    assert(isDerivedFromA(*pa));
    return 0;
}


thanks,
Phil
--
Philip Dunstan
[EMAIL PROTECTED]

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to