boost - C++ meaning of [ ] -


this question has answer here:

that's example of boosts asio. [this] mean? why []?

acceptor_.async_accept(socket_,     [this](boost::system::error_code ec) 

it lambda expression used create function expression

[] capture list

a list of symbols can passed follows:

  • [a,&b] captured value , b captured reference.
  • [this] captures pointer value
  • [&] captures automatic variables mentioned in body of lambda reference
  • [=] captures automatic variables mentioned in body of lambda value
  • [] captures nothing

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -