tags:

views:

33

answers:

1

Hello.

Can the following be done in a single line?

typedef BOOST_TYPEOF(generator) G;
typename G::value_type next;

typename BOOST_TYPEOF(generator)::value_type next; //does not compile

thank you

+2  A: 

Try to use mpl::identity

typename mpl::identity<BOOST_TYPEOF(generator)>::type::value_type next;

The macro is probably expanding to some compiler intrinsics like __typeof__(...) which aren't necessarily eligible to appear as nested name specifier. Even the C++0x proposed decltype(...) initially wasn't allowed before a ::, but is in the FCD.

Johannes Schaub - litb
thank you again.that does work and explanation makes sense to me
aaa