Boost C++ Libraries 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 a snapshot of the master branch, built from commit 97da996172.

Type from

boost::contract::from — Indicate the kind of operation where the contract assertion failed.


// In header: <boost/contract/core/exception.hpp>

enum from { from_constructor, from_destructor, from_function };


This is passed as a parameter to the assertion failure handler functions. For example, it might be necessary to know in which operation an assertion failed to make sure exceptions are never thrown from destructors, not even when contract failure handlers are programmed by users to throw exceptions instead of terminating the program.

See Also:

Throw on Failure

Assertion failed when checking contracts for constructors.
Assertion failed when checking contracts for destructors .
Assertion failed when checking contracts for functions (members or not, public or not).