|
Boost Users : |
From: John Maddock (john_at_[hidden])
Date: 2006-01-11 12:33:11
> Look at example code:
> BOOST_STATIC_ASSERT((boost::is_base_of<CBase,T>::value_type));
Should be:
BOOST_STATIC_ASSERT((boost::is_base_of<CBase,T>::value));
The code does then compile with gcc, but not with VC++ 7.1.
I think the problem here is that at the point you instantiate CTest,
CDerived is an incomplete type - the static assert then fails because the
compiler can't tell whether CDerived has any bases or not. I'm not sure if
this helps, but if the test were to be instantiated from one of CDerived's
member functions, then CDerived would be complete at the point of
instantiation and the problem would go away. As it stands though you've
given the compiler a cyclic instantiation-dependency, which it's free to
resolve any way it chooses.
HTH, John.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net