Boost C++ 库

...世界上最受推崇和设计精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu,《C++ 编码规范

函数 throw_length_error - Boost C++ 函数库
PrevUpHomeNext

函数 throw_length_error

boost::container::throw_length_error

提要

// In header: <boost/container/throw_exception.hpp>


void throw_length_error(const char * str);

描述

Boost.Container 在调整大小出错时调用的异常回调。

  • 如果未定义 BOOST_NO_EXCEPTIONS 且未定义 BOOST_CONTAINER_USE_STD_EXCEPTIONS,则抛出 boost::container::length_error(str)

  • 如果未定义 BOOST_NO_EXCEPTIONS 且定义了 BOOST_CONTAINER_USE_STD_EXCEPTIONS,则抛出 std::length_error(str)

  • 如果定义了 BOOST_NO_EXCEPTIONS 且未定义 BOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS,则调用 BOOST_ASSERT_MSG(!"boost::container length_error thrown", str),如果前者返回,则调用 std::abort()

  • 如果定义了 BOOST_NO_EXCEPTIONS 和 BOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS,则用户必须提供实现,并且该函数不应返回。


PrevUpHomeNext