Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Class bad_alloc

boost::log::bad_alloc — Base class for memory allocation errors.

Synopsis

// In header: <boost/log/exceptions.hpp>


class bad_alloc : public bad_alloc {
public:
  // construct/copy/destruct
  explicit bad_alloc(const char *);
  explicit bad_alloc(std::string const &);
  ~bad_alloc();

  // public member functions
  const char * what() const;
};

Description

Exceptions derived from this class indicate problems with memory allocation.

bad_alloc public construct/copy/destruct

  1. explicit bad_alloc(const char * descr);

    Initializing constructor. Creates an exception with the specified error message.

  2. explicit bad_alloc(std::string const & descr);

    Initializing constructor. Creates an exception with the specified error message.

  3. ~bad_alloc();

    Destructor

bad_alloc public member functions

  1. const char * what() const;

    Error message accessor.


PrevUpHomeNext