Boost C++ 库

……世界上评价最高、设计最精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, 《C++ 编码标准》

is_disposition - Boost C++ 函数库
PrevUpHomeNext

用于测试类型是否满足处置要求的特性。

template<
    typename T>
struct is_disposition :
  public integral_constant< bool, automatically_determined >

要成为有效的处置,类型必须是可隐式默认构造的 (nothrow default-constructible)、可隐式移动构造的 (nothrow move-constructible)、可隐式移动赋值的 (nothrow move-assignable),并且必须有一个针对该类型的 disposition_traits 模板的特化,该特化提供以下静态成员函数: * not_an_error: 接受一个 const T& 类型的参数,并返回一个 bool

  • throw_exception: 接受一个 T 类型的参数。此函数的调用者不得传递 not_an_error 返回 true 的处置值。此函数不得返回。
  • to_exception_ptr: 接受一个 T 类型的参数,并返回一个 std::exception_ptr 类型的值。
要求

头文件: boost/asio/disposition.hpp

便捷头文件: boost/asio.hpp


PrevUpHomeNext