std::contracts::detection_mode
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Utilities library
Type support (basic types, RTTI)
Library feature-test macros (C++20)
(C++11)
(C++20)
(C++26)
(C++20)
Coroutine support (C++20)
Contract support (C++26)
(C++20)(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
General utilities
Relational operators (deprecated in C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
(C++20)
Swap and type operations
Common vocabulary types
Contract support
Contract-violation information
(C++26)
(C++26)
(C++26)
detection_mode
(C++26)
Helper functions
Defined in header
<contracts>
enum class detection_mode : /* unspecified */ {
(since C++26)
predicate_false = 1,
evaluation_exception = 2
The enumerators of std::contracts::detection_mode
correspond to the reasons that cause the contract violation to happen under a context that is not manifestly constant-evaluated, with meanings listed below:
Enumerator
Meaning
predicate_false
the contract violation occurs because the result of the predicate is false
evaluation_exception
the contract violation occurs because the evaluation of the predicate exits via an exception
[edit] Notes
If a contract violation occurs in a context that is manifestly constant-evaluated, the contract-violation handler is not invoked.