Contract support (C++26) - cppreference.com (original) (raw)

The contract support library defines several types for reporting information about contract violations.

[edit] Contract-violation information

Defined in header
Defined in namespace std::contracts
contract_violation(C++26) the type holding the contract-violation information (class) [edit]
assertion_kind(C++26) the kind of the contract assertion violated (enum) [edit]
evaluation_semantic(C++26) the evaluation semantic when the contract violation occurs (enum) [edit]
detection_mode(C++26) the reason that causes the contract violation (enum) [edit]

[edit] Helper functions

[edit] Notes

Feature-test macro Value Std Feature
__cpp_lib_contracts 202502L (C++26) Contract support library