I was reading through the source code from Facebook's Proxygen, and I noticed some syntax I'd never seen before:
std::thread t([&] () {
server.start();
});
Source: https://github.com/facebook/proxygen/blob/master/proxygen/httpserver/samples/push/PushServer.cpp
Is it an anonymous method? And what is the value of &
, is it the thread?
It looks confusing because if it is an anonymous method how is server
accessible, isn't it out of scope?