Skip to content
UPEEC

Generic Lambdas

Lambdas with `auto` parameters work for any type (C++14); C++20 adds template parameter lists.

Intermediate
Comments 0

auto add = [](auto a, auto b) { return a + b; };

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.