Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Lambda expression, capture?

También llamado: lambda expression · capture (lambda)

Definition 5.6 University Computer Science — Year 2 · Capítulo 5 — The Standard Library: Containers, Iterators and Algorithms

A lambda expression [captures](parameters) { body } creates an unnamed function object, an object of a class generated by the compiler whose operator() runs the body. Its captures list the local variables of the enclosing function the body uses: [x] stores a copy of x in the object, [&x] a reference to it, [=] and [&] capture every variable the body uses, by copy or by reference.

Leer en el capítulo →