Why generic lambdas are allowed while nested structs with templated methods aren't?
问题 As far as I understand - generic lambdas are transformed into objects of local scope structs with templated operator() . This makes generic lambda very powerful and easy to use tool. On the other hand one can create structs nested into the function, when however the struct has templated member e.g.: #include <iostream> int main() { struct inner { template <class T> void operator()(T &&i) { } }; return 0; } or is templated by itself: int main() { template <class T> struct inner { void operator