#include <thread>
using namespace std;
struct Image {}; // dummy
void fill(int color, const Image& image) {
}
int main() {
int red;
Image img;
#if 1
thread th{
[&img](int c){ fill(c, img); }, red }; // Thread verwendet img
#else
auto f = [&img](int c){ fill(c, img); };
thread th{
f, red }; // Thread verwendet img
#endif
th.join();
}
I2luY2x1ZGUgPHRocmVhZD4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgpzdHJ1Y3QgSW1hZ2Uge307IC8vIGR1bW15Cgp2b2lkIGZpbGwoaW50IGNvbG9yLCBjb25zdCBJbWFnZSYgaW1hZ2UpIHsKfQoKaW50IG1haW4oKSB7CiAgaW50IHJlZDsKICBJbWFnZSBpbWc7CiNpZiAxCiAgdGhyZWFkIHRoewogICAgWyZpbWddKGludCBjKXsgZmlsbChjLCBpbWcpOyB9LCByZWQgfTsgLy8gVGhyZWFkIHZlcndlbmRldCBpbWcKI2Vsc2UKICBhdXRvIGYgPSBbJmltZ10oaW50IGMpeyBmaWxsKGMsIGltZyk7IH07CiAgdGhyZWFkIHRoewogICAgZiwgcmVkIH07IC8vIFRocmVhZCB2ZXJ3ZW5kZXQgaW1nCiNlbmRpZgogIHRoLmpvaW4oKTsKfQo=