Like closures in rust
https://doc.rust-lang.org/book/ch13-01-closures.html
Use case: Pass some behavior around
Compiler copies (captures) values into the generated lambda
If you capture by reference, you might end up with a dangling reference
Can lead to scope / lifetime issues; unlike what the borrow checker ensures in rust, lambdas can outlive the references they capture
C++ lambdas are more explicit: `[=]` (copy), `[&]` (reference). But the compiler **does not check lifetimes** — you must manage them yourself.
- **C++:** “I trust you, don’t dangle references.”
- **Rust:** “I won’t compile if there’s a lifetime risk.”