
30 May
2005
30 May
'05
2:17 p.m.
BOOST_TYPEOF( Z() ), where Z is a class type, gives different results in native and compliant modes, at least on gcc 3.2.2. #include <boost/typeof/typeof.hpp> #include <boost/mpl/assert.hpp> #include <boost/type_traits/is_same.hpp> #include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() struct Z {}; BOOST_TYPEOF_REGISTER_TYPE(Z) int main() { typedef Z(F)(); // function in native mode typedef BOOST_TYPEOF( Z() ) fn_or_class; // Which line should be commeneted? BOOST_MPL_ASSERT(( boost::is_same<fn_or_class,Z> )); BOOST_MPL_ASSERT(( boost::is_same<fn_or_class,F> )); } -- Alexander Nasonov