Subject: Re: [boost] [result_of] now uses decltype on release branch
From: Michel Morin (mimomorin_at_[hidden])
Date: 2012-09-08 12:02:12
Daniel Walker wrote:
>> Not a small number of people have complained about the disability of
>> std/boost::result_of for SFINAE.
> Where has this come up before? I just don't remember. It would be
> interesting to know the history of this problem.
I learned this problem from this blog post:
(Note: written in Japanese
This post listed defects in FDIS. One of them is that some meta-functions
(std::result_of and common_type) cannot be used for SFINAE.
On gcc bugzilla, Paolo Carlini said the following
( http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50711 )
Unfortunately, I don't think you can use std::result_of for sfinae purposes,
if I understand correctly it's a well know annoyance which you have to
overcome by open coding with std::declval.
Eg, if you simply open the <functional> header you will find plenty of
decltype( std::declval... for sfinae, which cannot be replaced by a concise
Also, quick google finds an old boost-user ML post:
( http://thread.gmane.org/gmane.comp.lib.boost.user/9967/focus=10030 )
From: Ian McCulloch
Subject: Re: result_of tutorial
Date: 2005-03-17 08:22:29 GMT
Thanks Peter, I think I understand how it works now. Unfortunately, the
lack of SFINAE is a real showstopper for me. I want to write functions
template <typename T>
operator-(T const& x)
but the lack of SFINAE here makes boost::result_of essentially useless for
this. But I imagine it won't be difficult to make a new version based on
boost that would work.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk