Boost logo

Boost :

From: Philip Dunstan (phil_at_[hidden])
Date: 2003-04-29 18:33:59

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;
    return 0;


Philip Dunstan

Boost list run by bdawes at, gregod at, cpdaniel at, john at