
Steven Watanabe wrote:
AMDG
Mathias Gaunard wrote:
Beman Dawes wrote:
See http://svn.boost.org/svn/boost/branches/cpp0x
This branch adds the following config macros:
[...] BOOST_NO_DECLTYPE [...]
I see that this macro is defined for GCC 4.3+ when std=c++0x is not used. However, decltype is still available with __decltype__ outside of C++0x experimental mode.
Would a #define decltype __decltype__ on this compiler not be a better idea?
No it wouldn't. A BOOST_DECLTYPE macro would be acceptable, but effectively overriding the default -std is not a good idea, as it can affect user code.
Agreed. When we in effect alter the behavior of a compiler and/or language, it is far less confusing to users to do it in a loud and noisy fashion (BOOST_DECLTYPE) than silently (#define decltype __decltype__). Macros that silently change language features have a long history of unintended consequences. --Beman