I have a function that returns a boost::asio::awaitable
that takes a large message object as argument to write a serialized string to a socket. Recently I was reading that a coroutine function will always suspend on entry and has the potential to create dangling references. I also read that you can prevent it from suspending which the author called a hot start. Is there a way to make boost::asio::awaitable
not suspend initially so I can pass by reference safely before the first co_await
?
article: https://devblogs.microsoft.com/oldnewthing/20210331-00/?p=105028