Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] wrap lambda async_receive call
From: Cheng Mo (chmhou_at_[hidden])
Date: 2015-03-19 02:16:38

Hi Gavin:

>Having said this, using lambdas can get tricky in real-world code, as
>it's common to want to start the same read operation when the first
>completes, and so on.

Just like you said, will the code build a lambda expression when async_read() invoked ?
So that "[=](const error_code& ec, size_t count" will be built servial times, it is kind of lavish for contructing the lambda expression, isn't ?
It's better that build a function object in static. What do you think ?


µØÖ·£º±±¾©Êк£µíÇøÎ÷±±ÍúÕò ·áÖǶ«Â·3ºÅÔº
Mail: mcheng_at_[hidden]

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at