
"Doug Gregor" <dgregor@osl.iu.edu> wrote
"Doug Gregor" <dgregor@osl.iu.edu> wrote
I meant, why not have the typeof library use decltype when it is available? You can just predicate on BOOST_HAS_DECLTYPE, and of course test with the latest GCC 4.3.
I think BOOST_TYPEOF should continue returning consistent result across the compilers. For this, if we used decltype, we would need to remove top-level consts and refs... which doesn't seem to make a lot of sense...
typename remove_cv<typename remove_reference<decltype(EXPR)
::type>::type
is still a lot simpler than what BOOST_TYPEOF has to go through to get the type of an expression... you could save a lot of compile time using decltype.
Well, if typeof is available, BOOST_TYPEOF does use it rather than perform the emulation, so it's rather something like: #define BOOST_TYPEOF(expr) typeof(expr) (or almost like this)
Does GCC 4.3 still have typeof?
It's still there, although I don't know how useful it is.
Doesn't GCC care about backward compatibility? Regards, Arkadiy