Boost Asio 的 steady_timer::cancel()
可能会抛出 boost::system::system_error
。
什么情况下会发生这种情况?
当前的 Networking TS 有一个 basic_waitable_timer
,但不具有 noexcept
.cancel()
函数。这里是否忘记了 noexcept
或者该函数也可以抛出异常?
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4734.pdf [timer.waitable.ops]
最佳答案
Under what circumstances can this happen?
我想不起来了。请注意,采用 error_code 引用的重载已被弃用:(Deprecated: Use non-error_code overload.)
这告诉我错误接口(interface)过多。
关于c++ - Asio 的计时器在取消时什么时候会抛出异常?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49836088/