Boost logo

Boost Users :

Subject: Re: [Boost-users] [range] cannot use lambda predicate in adaptor with certain algorithms
From: Michel MORIN (mimomorin_at_[hidden])
Date: 2011-05-30 12:41:24


Hi Akira,

Akira Takahashi wrote:
> Hi, Michel.
>
>> `#define BOOST_RESULT_OF_USE_DECLTYPE` is necessary to compile
>> the above code. Without this, we have compiler errors (the oven library
>> seems not fully compatible with new compilers yet).
>
> I am Oven Library mantainer(now manager).

Good to know :)

> 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.)

Regards,
Michel


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net