Tag: lambda
12 posts
-
C++20 Template Lambdas: []<typename T> Syntax, Concept Constraints and When They Beat auto
C++20 template lambdas: `[]<typename T>(T a, T b)`, concepts constraints, parameter packs, and when they beat generic `auto` lambdas.
-
C++ Generic Lambdas — auto Parameters and Template Lambdas
Generic lambdas in C++14: auto makes operator() a template, C++20 template lambdas, STL patterns, deduction rules, performance, and common pitfalls.
-
C++14 Init Capture: Moving unique_ptr into Lambdas, Reference Init and Evaluation Time
C++14 init capture [x = expr]: auto-style deduction, when it runs, moving unique_ptr in, why std::function rejects it, [&r = x], [*this] and pack capture.
-
C++ Lambda Capture: By Value, By Reference, Init Capture, and the Lifetime Bugs Each One Invites
How C++ lambda captures really work: copies taken at creation time, [=] silently capturing this, mutable state duplicated by std::function, move-only captures, and dangling references.
-
C++ Lambda Expressions: Capture Modes, mutable, Generic Lambdas and Dangling References
C++ lambda expressions: [=]·[&] capture, sort and find_if usage, mutable, generic lambdas, threads, and dangling-reference pitfalls—practical guide.
-
Lambdas That Crash Later: Dangling Reference Captures and How to Capture Safely
Why a stored C++ lambda crashes long after creation: dangling [&] captures, the hidden this in [=], move-only captures and std::function, and safe patterns.
-
C++17 constexpr Lambdas: Implicit constexpr, Captures, and Limits
How C++17 constexpr lambdas work: when a lambda is implicitly constexpr, capture rules for constant evaluation, real GCC errors, and C++20 changes.
-
Serverless with AWS Lambda: API Gateway, DynamoDB, S3 Events and Cold Starts
AWS Lambda in practice: the execution model, API Gateway handlers, DynamoDB, S3 triggers without recursive loops, UTC schedules and cold start fixes.
-
Python Functions: Parameters, Defaults, Closures, and the Traps Behind Them
How Python functions really behave: positional-only and keyword-only parameters, the mutable default trap, late-binding closures, nonlocal, and functools.wraps.
-
The Strategy Pattern in C++: Virtual Classes vs Function Pointers vs Lambdas vs std::function
Strategy pattern in C++: polymorphic strategies, function pointers, lambdas, std::function—sorting and compression examples; performance trade-offs.
-
C++ Lambda Basics: [=] and [&] Capture, mutable, and Lambdas with STL Algorithms
C++ lambdas: [=] [&] capture, mutable, generic lambdas, std::function recursion pitfalls, STL algorithms, and dangling reference bugs—practical guide.
-
std::function vs Function Pointers vs Template Callables in C++: Type Erasure Cost, SBO and C Interop
std::function vs function pointer vs template in C++: why capturing lambdas cannot convert, when std::function allocates, move-only captures, C void* data.