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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -