Hughes, James wrote:
Just a quick addendum to this. I tried out a combination of the two - using a BOOST_STATIC_ASSERT((boost::is_base_of
>::value)) inside the do_it function described above, and found what I thought was odd behaviour with is_base_of. The following excerpt shows the behaviour
class A {};
class B : public A {};
typedef A C;
BOOST_STATIC_ASSERT((boost::is_base_of >::value)) // this passes
BOOST_STATIC_ASSERT((boost::is_base_of >::value)) // this fails
I would expect both to pass, as is_base_of should return true when both parameters are the same, and I thought that typedef did make classes the same/equivalent
http://www.boost.org/doc/html/boost_typetraits/reference.html#boost_typetrai...
Is there something I am missing about typedef? Or is boost::is_base_of unable to handles the aliasing?
James
Hi James, I tried this with GCC 4.2 and 3.4.6 under Linux. It passes for both cases. So it might be your compiler, which is doing something wrong. Martin