logoalt Hacker News

do_not_redeemlast Sunday at 6:24 PM1 replyview on HN

Nothing about lambdas requires heap allocation. See also: C++, Rust


Replies

porridgeraisinlast Sunday at 7:00 PM

If the lambda captures some value, and also outlives the current scope, then that captured value has to necessarily be heap allocated.

show 2 replies