Asynchronous functions often do not use exceptions.
Even on synchronous calls, Asio and Boost-Beast have overloads that take an output argument of type system_error&
instead of throwing.
Asynchronous operations can't throw exceptions because the operation doesn't complete in the stack frame of the calling code¹.
Is there a technical reason why these are not declared noexcept
?
Apart from possible performance advantages, I also think it would be useful as a hint for the user, because the user knows they don't need exception handling.
¹ technically, they might throw exceptions like on precondition checks or invalid arguments