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 ?

Cheers~
 



Cheer~
 
³ÌÄ«
PBI¡ª±±¾©¼ÓάͨѶµç×Ó¼¼ÊõÓÐÏÞ¹«Ë¾
µØÖ·£º±±¾©Êк£µíÇøÎ÷±±ÍúÕò ·áÖǶ«Â·3ºÅÔº
Óʱࣺ100094
Mail: mcheng_at_[hidden]



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net