[Cs3] Lambda Return Type

Mikhail Nesterenko mikhail at cs.kent.edu
Thu Oct 12 13:26:07 EDT 2017


> 
> I'm a bit unclear on the use of return types in lambdas. If the the return
> type is omitted, are we allowed to have non-void lamdas with multi-line
> bodies (and a single return statement)? My understanding from reading
> CppReference <http://en.cppreference.com/w/cpp/language/lambda> is that the
> deduction of the lamda's return type resolves to void unless the body is
> only a single return statement ("body consists of ... nothing but a single
> return statement", until C++14). Do I have the right of it?
> 
> Also, the book and CppReference give the syntax for lambdas with the return
> type on the other side of the parameters from what's in the slides.

We'll trust the C++ reference. I've fixed the slides.

Thanks,
-- 
Mikhail


More information about the cs3 mailing list