Namespaces
Variants
Actions

std::contracts::detection_mode

From cppreference.com
< cpp‎ | contract
 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
(C++20)(C++20)(C++20)  
(C++20)
(C++20)
(C++14)
(C++11)
(C++11)
(C++23)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)


 
Contract support
Contract-violation information
detection_mode
(C++26)
Helper functions
 
Defined in header <contracts>
enum class detection_mode : /* unspecified */ {

    predicate_false = 1,
    evaluation_exception = 2

};
(since C++26)

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.

[edit] See also

the type holding the contract-violation information
(class) [edit]
the kind of the contract assertion violated
(enum) [edit]
the evaluation semantic when the contract violation occurs
(enum) [edit]
Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/contract/detection_mode&oldid=182035"

AltStyle によって変換されたページ (->オリジナル) /