Boost logo

Boost :

Subject: Re: [boost] [result_of] Allow result_of to work with C++11 lambdas
From: Nathan Crookston (nathan.crookston_at_[hidden])
Date: 2013-04-20 17:25:33


Hi Daniel,

Daniel Walker wrote:

> Nathan Crookston wrote:
> >
> > I just wanted to ping on this; see if someone's had time to review the
> > patch. I failed to mention that the same parts of the full test suite
> > passes on VC10 before and after the patch, so there's some assurance that
> > it's correct.
>
> OK, I finally had a chance to look at the patch. The implementation is
> fine, but the configuration, documentation and tests allow/imply that
> BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK is enabled by default on
> certain compilers. I believe we should not stealthily change the default
> behavior. It seems to me that the migration path we adopted years ago
> should remain in place: the default behavior of boost:result_of will only
> change if your compile supports N3276, in which case you will get the full
> decltype implementation.
>
> I think it would be best to introduce this functionality as a third
> option; i.e. one that the user opts into by explicitly defining
> BOOST_RESULT_OF_USE_TR1_WITH_DECLTYPE_FALLBACK. (That's a good name for the
> macro, BTW.) If you could update the patch, I'd be glad to apply it.
>

Thanks for looking over the patch! I'd be happy to make the change, if
that means getting the functionality into boost. However, I think that the
decltype fallback should be enabled at least for those compilers which have
both a lacking decltype implementation and C++11 lambdas. This doesn't
change the migration path, of course -- as N3276 is implemented in more
compilers, more compilers will use the straight (standards conforming)
decltype implementation.

I don't think there are typical situations where someone using lambda
functions would *not* want boost::result_of to work for it. However, I'll
submit a patch updated as you request in a few days, unless I and/or others
can help change your mind. ;)

Thanks,
Nate


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