[typeof] help needed with gcc 3.2.x/3.3.x linux

Could anybody with one of those compilers installed help me figure out why they complain about this code: //--------------- #include <boost/typeof/typeof.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/static_assert.hpp> void f() {} template<class T> class x { BOOST_STATIC_ASSERT(( boost::is_same<BOOST_TYPEOF_TPL(&f), void(*)()>::value )); }; //--------------- I suspect the problem is related to the test itself rather than to typeof, and might be workarounded (or is it "worked around"?) with a couple of intermediate typedefs, but I might be wrong... Thanks in advance, Arkadiy

Arkadiy Vertleyb wrote:
Could anybody with one of those compilers installed help me figure out why they complain about this code:
You might want to try using BOOST_NESTED_TEMPLATE. These versions of GCC mistake '<' for the less operator in some contexts.
boost::is_same<BOOST_TYPEOF_TPL(&f), void(*)()>::value
boost::BOOST_NESTED_TEMPLATE is_same<... Regards, Tobias

Tobias Schwinger wrote:
Arkadiy Vertleyb wrote:
Could anybody with one of those compilers installed help me figure out why they complain about this code:
Well, was rather guessing...
You might want to try using BOOST_NESTED_TEMPLATE. These versions of GCC mistake '<' for the less operator in some contexts.
In case you're talking about that Typeof regressions with the internal error (you didn't say) it won't help: the error message says "in instantiation...". Regards, Tobias
participants (2)
-
Arkadiy Vertleyb
-
Tobias Schwinger