google / marl

A hybrid thread / fiber task scheduler written in C++ 11
Apache License 2.0
1.85k stars 192 forks source link

Make implicit `this` capture explicit #266

Closed DKLoehr closed 2 months ago

DKLoehr commented 2 months ago

When declaring a lambda with a value-capture default [=, ...], the this pointer is implicitly captured by value as well. This results in potentially-unintuitive behavior (https://reviews.llvm.org/D142639) and produces a warning in newer versions of clang.

This commit simply makes the implicit capture explicit, preventing the warning.