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,则用户必须提供实现,并且该函数不应返回。