why this return type is not void in C++/WinRT? and What does this do?
Apart from documentation for Fire and forget, note the following: the function itself uses co_await
operator in its body.
This requires that the function itself is coroutine friendly and could be compiled into "stackless" form, for asynchronous execution. void
return type does not work out, but fire_and_forget
struct is okay because C++/WinRT defines coroutine handling for it, as explained by the documentation.
Think of this as void
which can be asynchronous and has no need to be waited on.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…