C++14 lambda's default argument type deduction depending on preceding arguments
问题 Is this not valid as C++14? auto f = [](auto x, auto y = std::decay_t<decltype(x)>{}) { }; f(0); I was expecting it to be roughly equivalent to auto f = [](int x, int y) { }; f(0, int{}); Neither GCC 6.3 nor Clang 4.0 accepted my code. http://ideone.com/b7b4SK GCC http://ideone.com/EyLYaL Clang Is it related to my lack of understanding of C++ template deduction phases? Does the 1400 pages long spec actually has an explicit answer to my question? Update To summarize, my problem can in fact be