C++ Snippet
C++ Lambda Basics
Difficulty: Easy
Lambdas (C++11+) are first-class anonymous function objects with a compact syntax: `[capture](params) { body }`. This snippet covers the basic form, the difference between by-value `[=]` and by-reference `[&]` captures, and using lambdas with standard algorithms like `std::sort` and `std::for_each`. Reach for them anywhere you would write a small functor or pass a callback.
