c++ - References for type deduction lambda -
i saw this answer i'm not satisfied: written in standard type deduction 'auto' not consider default arguments?
int main() { auto lambda = [] (auto subl = [] {}) {}; lambda(); }
auto
uses rules according template argument deduction ([dcl.spec.auto] /p7):
if placeholder auto type-specifier, deduced type determined using rules template argument deduction.
default arguments explicitly non-deduced context when type deduced template parameter ([temp.deduct.type]/p5):
the non-deduced contexts are:
— nested-name-specifier of type specified using qualified-id.
— expression of decltype-specifier.
— non-type template argument or array bound in subexpression references template parameter.
— a template parameter used in parameter type of function parameter has default argument being used in call argument deduction being done.
Comments
Post a Comment