Top "Lambda" questions

DO NOT USE FOR THE AWS SERVICE (use [aws-lambda] for those questions!

Why can't I capture this by-reference ('&this') in lambda?

I understand the correct way to capture this (to modify object properties) in a lambda is as follows: auto f = […

c++ c++11 lambda
E731 do not assign a lambda expression, use a def

I get this pep8 warning whenever I use lambda expressions. Are lambda expressions not recommended? If not why?

python lambda pep
Can a C# lambda expression have more than one statement?

Can a C# lambda expression include more than one statement? (Edit: As referenced in several of the answers below, this …

c# lambda
Why must a lambda expression be cast when supplied as a plain Delegate parameter

Take the method System.Windows.Forms.Control.Invoke(Delegate method) Why does this give a compile time error: string str = "…

c# c#-3.0 delegates lambda
Java 8 extract first key from matching value in a Map

Suppose I have a map of given name, surname pairs and I want to find the given name of the …

java lambda java-8 java-stream optional
Java8 Lambdas vs Anonymous classes

Since Java8 has been recently released and its brand new lambda expressions looks to be really cool, I was wondering …

java lambda java-8 anonymous-class
Lambda capture as const reference?

Is it possible to capture by const reference in a lambda expression? I want the assignment marked below to fail, …

c++ c++11 lambda c++14
Why does C++11's lambda require "mutable" keyword for capture-by-value, by default?

Short example: #include <iostream> int main() { int n; [&](){n = 10;}(); // OK [=]() mutable {n = 20;}(); // OK // [=](){n = 10;}(); // Error: a by-value …

c++ lambda c++11
Does Go have lambda expressions or anything similar?

Does Go support lambda expressions or anything similar? I want to port a library from another language that uses lambda …

go lambda
Max return value if empty query

I have this query: int maxShoeSize = Workers .Where(x => x.CompanyId == 8) .Max(x => x.ShoeSize); What will be …

c# .net entity-framework linq lambda