[
Note 5:
If the generic lambda has no
trailing-return-type or
the
trailing-return-type contains a placeholder type, return type
deduction of the corresponding function call operator template specialization
has to be done
. The corresponding specialization is that instantiation of the
function call operator template with the same template arguments as those
deduced for the conversion function template
. Consider the following:
auto glambda = [](auto a) { return a; };
int (*fp)(int) = glambda;
The behavior of the conversion function of glambda above is like
that of the following conversion function:
struct Closure {
template<class T> auto operator()(T t) const { }
template<class T> static auto lambda_call_operator_invoker(T a) {
}
template<class T> using fptr_t =
decltype(lambda_call_operator_invoker(declval<T>())) (*)(T);
template<class T> operator fptr_t<T>() const
{ return &lambda_call_operator_invoker; }
};
—
end note]