That's from an example of boosts asio. What does [this] mean? why the []?
acceptor_.async_accept(socket_,
[this](boost::system::error_code ec)
always used before a noun. : exactly the same as something else. I began receiving duplicate copies of the magazine every month.
Duplicate data is any record that inadvertently shares data with another record in a Database. Duplicate data is easy to spot and it mostly occurs when transferring data between systems. The most popular occurrence of duplicate data is a complete carbon copy of a record.
It's called duplicate work – literally redoing work that's already been done – and you can just imagine what it's doing to your productivity.
It is a lambda expression used to create a function as an expression
[]
is the capture list
A list of symbols can be passed as follows:
- [a,&b] where a is captured by value and b is captured by reference.
- [this] captures the this pointer by value
- [&] captures all automatic variables mentioned in the body of the lambda by reference
- [=] captures all automatic variables mentioned in the body of the lambda by value
- [] captures nothing
It is a part of a lambda expression. Look here for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With