Boost logo

Boost :

Subject: Re: [boost] [utility/result_of] decltype-based implementation breaking valid code on msvc-10
From: Daniel Walker (daniel.j.walker_at_[hidden])
Date: 2010-04-06 08:59:26


On Tue, Apr 6, 2010 at 3:52 AM, Daniel James <dnljms_at_[hidden]> wrote:
> On 5 April 2010 22:59, Eric Niebler <eric_at_[hidden]> wrote:
>>
>> I suspect the real problem is in a buggy implementation of decltype on
>> msvc-10. For the upcoming boost release, I suggest that we stick with the
>> non-decltype implementation of result_of on msvc-10, or risk massively
>> breaking users' code, not to mention proto, spirit and xpressive on that
>> compiler.
>
> I think this is my fault. I was updating the use of config macros,
> which caused it to use decltype for Visual C++ 10. For other libraries
> I submitted tickets but since no one seemed to be maintaining
> result_of I made that change myself. I'll revert it for now but we
> should probably change config to define BOOST_NO_DECLTYPE for Visual
> C++ 10 if it's buggy on that compiler.

Well, msvc-10 decltype may have enough functionality for some
libraries, but not enough for others. BOOST_NO_DECLTYPE should
probably indicate the availability of the keyword. As we discover
more, other macros may be needed to account for quirks in different
compilers. I would suggest defining BOOST_NO_DECLTYPE only on
platforms that do not attempt to implement it. If a particular
decltype implementation doesn't work for result_of, then for that
compiler result_of can fallback to querying result<>. Of course, I
almost forgot, this should be mentioned in the user documentation for
result_of

Daniel Walker

Daniel Walker


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk