#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();
}
