Boost C++ 库

...世界上最受推崇、设计最精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ Coding Standards

Function throw_length_error - Boost C++ 函数库
PrevUpHomeNext

Function 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