Boost C++ 库

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

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

函数 throw_out_of_range

boost::container::throw_out_of_range

提要

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


void throw_out_of_range(const char * str);

描述

Boost.Container 调用异常回调函数,用于指示参数超出范围。

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

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

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

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


PrevUpHomeNext