The lambda return type is auto, which is replaced by the
type specified by the
trailing-return-type if provided and/or deduced from
return statements as described in [dcl.spec.auto].
[Example 2: auto x1 =[](int i){return i; }; // OK: return type is intauto x2 =[]{return{1, 2}; }; // error: deducing return type from braced-init-listint j;
auto x3 =[]()->auto&&{return j; }; // OK: return type is int& — end example]
[Example 3: int i =[](int i, auto a){return i; }(3, 4); // OK: a generic lambdaint j =[]<class T>(T t, int i){return i; }(3, 4); // OK: a generic lambda — end example]