In some environments, such as game development or embedded systems, C++ exceptions are disabled or a customized error handling is needed. According to document N2271 EASTL -- Electronic Arts Standard Template Library exceptions can be disabled for several reasons:
In order to support environments without C++ exception support or environments
with special error handling needs, Boost.Container
changes error signalling behaviour when
BOOST_NO_EXCEPTIONS is defined.
The former shall be defined by the user and the latter can be either defined
by the user or implicitly defined by Boost.Confg
when the compiler has been invoked with the appropriate flag (like
-fno-exceptions in GCC).
When dealing with user-defined classes, (e.g. when constructing user-defined classes):
BOOST_NO_EXCEPTIONSis defined, the library avoids using
throwstatements. The class writer must handle and propagate error situations internally as no error will be propagated through Boost.Container.
BOOST_NO_EXCEPTIONSis not defined, the library propagates exceptions offering the exception guarantees detailed in the documentation.
When the library needs to throw an exception (such as
when an incorrect index is used in
library calls a throw callback declared in
BOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKSis defined, then the programmer must provide its own definition for all
throw_xxxfunctions. Those functions can't return, they must throw an exception or call
BOOST_NO_EXCEPTIONSis defined, a
BOOST_ASSERT_MSGassertion is triggered (see Boost.Assert for more information). If this assertion returns, then