Namespaces
Variants

std::contracts:: detection_mode

From cppreference.net
Utilities library
Contract support
Contract-violation information
detection_mode
(C++26)
Helper functions
헤더 파일에 정의됨 <contracts>
enum class detection_mode : /* unspecified */ {

predicate_false = 1 ,
evaluation_exception = 2

} ;
(C++26부터)

std::contracts::detection_mode 의 열거자들은 계약 위반이 명백하게 상수 평가되는 컨텍스트가 아닌 상황에서 발생하도록 하는 원인들에 대응하며, 그 의미는 아래와 같습니다:

열거자 의미
predicate_false 계약 위반이 술어의 결과가 false 이기 때문에 발생함
evaluation_exception 계약 위반이 술어 평가가 예외를 통해 종료되기 때문에 발생함

참고 사항

명백히 상수 평가되는 상황에서 계약 위반이 발생하는 경우, contract-violation handler 는 호출되지 않습니다.

참고 항목

계약 위반 정보를 담는 타입
(class)
위반된 계약 어서션의 종류
(enum)
계약 위반 발생 시 평가 의미론
(enum)