| Home | Libraries | People | FAQ | More

## Function throw_bad_alloc

boost::container::throw_bad_alloc

## Synopsis

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

    BOOST_NORETURN void throw_bad_alloc();

## Description

Exception callback called by Boost.Container when fails to allocate the requested storage space.

- If BOOST_NO_EXCEPTIONS is NOT defined `std::bad_alloc()` is thrown.

- If BOOST_NO_EXCEPTIONS is defined and BOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS is NOT defined `BOOST_ASSERT(!"boost::container bad_alloc thrown")` is called and `std::abort()` if the former returns.

- If BOOST_NO_EXCEPTIONS and BOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS are defined the user must provide an implementation and the function should not return.