4 ms·
You capture by value a variable that allocates and you get a heap allocation.
by huhtenberg 5y ago
You capture by value a variable that allocates and you get a heap allocation.
- kllrnohj 5y agoThat's dependent on the captured type's copy (or move) behavior, and is completely different from your claim that how the lambda is used can influence this. Lambdas themselves never heap allocate.