Re: [Cppcms-users] Server-Sent Events Example
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-08-14 19:06:59
|
----- Original Message ----- > From: Barbu Paul - Gheorghe <bar...@gm...> > To: Artyom Beilis <art...@ya...>; cpp...@li... > Cc: > Sent: Tuesday, August 14, 2012 6:52 PM > Subject: Re: [Cppcms-users] Server-Sent Events Example > > On 08/12/2012 11:54 PM, Artyom Beilis wrote: >> Published there: >> >> http://blog.cppcms.com/post/107 > > Hi, I have a question about: > > context->async_on_peer_reset([=](){ > this->waiters_.erase(context); > }); > > Why are you catching things in the labda by value, not by reference? > Because I need to variables: - "this" witch technically may be captured by reference as well, but not really needed. - "context" - the shared_ptr on the http::context that would go out of scope when the callback is called. > > -- > Barbu Paul - Gheorghe > Common sense is not so common - Voltaire > Visit My GitHub profile to see my open-source projects - > https://github.com/paullik > Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |