Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 8d 09h 54m 30s8 days 9 hours 54 minutes 30 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 8d 09h 54m 30s8 days 9 hours 54 minutes 30 seconds.

Sign in to watch this lesson
Templates and Generic Programming · 4:29
How do you hand an algorithm a piece of behaviour? We build a function object, see why the compiler can inline it where a function pointer gets in the way, and then open up a lambda to find the ordinary class the compiler writes for it: captures become members, the body becomes a const call operator. We finish with init captures, generic and constexpr lambdas, and the classic dangling captured-this bug, caught by AddressSanitizer and fixed with [*this].