https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68515

TC <rs2740 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rs2740 at gmail dot com

--- Comment #3 from TC <rs2740 at gmail dot com> ---
FWIW, I don't see a bug here. The note in [temp.deduct]/8 explicitly calls out
"Attempting to create a function type in which a parameter type or the return
type is an abstract class type" as a cause for deduction failure. What one
plans to do with the type is irrelevant; deduction fails as soon as you attempt
to form one.

In any event, the only reason this is an issue for the original example is
because it uses result_of incorrectly. The actual call is 'f(x[i])' - i.e., it
is calling a const F lvalue with the result of vector's const operator[], which
returns 'typename vector<T>::const_reference' (which is const T& except for
vector<bool>). The correct result_of invocation is therefore 'typename
std::result_of<const F&(typename std::vector<T>::const_reference)>::type'
(which should probably be then decayed since the example creates a vector of
it).

Reply via email to