Boost logo

Boost :

Subject: Re: [boost] [result_of] Make `cpp0x_result_of_impl` public
From: Philipp Moeller (philipp.moeller_at_[hidden])
Date: 2012-03-28 04:53:55

"Stephan T. Lavavej" <stl_at_[hidden]> writes:

> [STL]
>> Sorry, I haven't been following this thread, but VC10 has decltype v1.0 (not v1.1) and its std::result_of follows the TR1 protocol (not decltype-powered). Is that of interest?
>> (VC11 has decltype v1.1 and its std::result_of is decltype-powered.)
> [Eric Niebler]
>> Thanks, Stephan. That makes the picture murkier. So do we add
>> cxx11_result_of, support it, doc it and test it indefinitely, for the
>> sake of the users of one version of one compiler? <sigh!>

Although this makes it more of a compelling use case. Given that the
picture is really grim. We have compilers that implement a

* fully conforming result_of
* result_of with a broken decltype
* result_of without decltype

My current approach has been to fall back on std::result_of if I want to
provide support for lambdas in my code and need to forward them (and if
the compiler supports them) and otherwise fall back to
boost::result_of. Compilers that support lambdas but not a working
std::result_of make this seem dubious and the correct implementation
with full support for everything would be do check for a conforming
decltype, a C++11 result_of and lambda support and bring all this
together to pick the right version. This seems a lot of pain for
something that hopefully will go away, but it would be nice if I had
some library support to write code like that. ;)

Philipp Moeller

Boost list run by bdawes at, gregod at, cpdaniel at, john at