On Mon, May 30, 2011 at 12:41 PM, Michel MORIN
Akira Takahashi wrote:
C++0x lambda hasn't result_type typedef
Ah, this is the reason for the compiler error. Thanks for correcting me.
(Cc'ing to Daniel) So, when using boost::result_of with C++0x lambda functions, we have to define BOOST_RESULT_OF_USE_DECLTYPE. This is a bit bothersome, and so I expect that, in the future, BOOST_RESULT_OF_USE_DECLTYPE gets automatically defined in compilers with N3276 support. Something like // boost/utility/result_of.hpp #ifndef #BOOST_NO_DECLTYPE_N3276 #define BOOST_RESULT_OF_USE_DECLTYPE #endif ? (BOOST_NO_DECLTYPE_N3276 is not yet included in Boost.Config.)
At some point, BOOST_RESULT_OF_USE_DECLTYPE may be defined by default,
probably when there's enough user interest, so thanks for cc'ing me.
The reason it is currently not defined by default is that it is
possible that it could introduce breaking changes to some C++03
function objects; e.g. if a function object defines result_type to be
some type other than the type of a call expression, then in C++03
result_of would give the user-specified result_type rather than the
actual result type, whereas in C++0x result_of always gives the actual
result type. For example:
#include