I'm new to C++ and while learning and documenting about the subject, I stumbled accross something that intrigued me :
[this](type argument)
{
// code
}
What does [this] stand for in this function ?
Here's the whole function in which I found this :
void do_accept()
{
acceptor_.async_accept(socket_,
[this](boost::system::error_code ec)
{
if (!ec)
{
std::make_shared<chat_session>(std::move(socket_), room_)->start();
}
do_accept();
});
}
(It's one of the boost.asio's asynchronous server example)