When does an asio timer go out of scope?

Posted by ApplePieIsGood on Stack Overflow See other posts from Stack Overflow or by ApplePieIsGood
Published on 2010-03-13T01:59:04Z Indexed on 2010/03/13 2:07 UTC
Read the original article Hit count: 393

Filed under:
|
|
|

What I mean is, let's say you do an async_wait on an asio timer and bind the update to a function that takes a reference to a type T. Let's say you created the T initially on the stack before passing it to async_wait. At the end of that async_wait, it calls async_wait itself, renewing the timer over and over. Does that stack allocated type T stay alive until the first time the timer doesn't renew itself, or after the first invocation of the function will the T go out of scope?

© Stack Overflow or respective owner

Related posts about boost

Related posts about asio