class contract_violation;
(since C++26)The class std::contracts::contract_violation
defines the type of objects used to represent a contract violation that has been detected during the evaluation of a contract assertion with a particular evaluation semantic.
Objects of this type can only be created by the implementation when the contract-violation handler needs to be invoked. Users cannot create such objects directly.
[edit] Member functionscontract_violation
objects cannot be constructed by users
contract_violation
objects cannot be assigned
(destructor)
[possibly virtual]
destructs thecontract_violation
object
contract_violation( const contract_violation& ) = delete;
(since C++26)The copy destructor is defined as deleted. std::contracts::contract_violation
is not CopyConstructible.
Other constructors are for internal usage only, they are not user-accessible.
std::contracts::contract_violation::operator=contract_violation& operator=( const contract_violation& ) = delete;
(since C++26)The copy assignment operator is defined as deleted. std::contracts::contract_violation
is not CopyAssignable.
/* see below */ ~contract_violation();
(since C++26)Destructs the contract_violation
object.
It is implementation-defined whether the destructor is virtual.
std::contracts::contract_violation::kindstd::contracts::assertion_kind kind() const noexcept;
(since C++26) Return valueReturns the enumerator value corresponding to the syntactic form of the violated contract assertion.
std::contracts::contract_violation::semanticstd::contracts::evaluation_semantic semantic() const noexcept;
(since C++26) Return valueReturns the enumerator value corresponding to the evaluation semantic with which the violated contract assertion was evaluated.
std::contracts::contract_violation::is_terminatingbool is_terminating() const noexcept;
(since C++26) Return valueIf the evaluation semantic is a terminating semantic, returns true. Otherwise returns false.
std::contracts::contract_violation::detection_modestd::contracts::detection_mode detection_mode() const noexcept;
(since C++26) Return valueReturns the enumerator value corresponding to the reasons that cause the contract violation.
std::contracts::contract_violation::evaluation_exception Return valueIf the contract violation occurred because the evaluation of the predicate exited via an exception, returns an std::exception_ptr object that refers to that exception or a copy of that exception. Otherwise, returns a null std::exception_ptr object.
const char* comment() const noexcept;
(since C++26) Return valueReturns an implementation-defined null-terminated multibyte string in the ordinary literal encoding.
NotesThe C++ standard recommends that the string returned should contain a textual representation of the predicate of the violated contract assertion or an empty string if storing a textual representation is undesired.
std::contracts::contract_violation::location Return valueReturns a std::source_location object with implementation-defined value.
NotesThe C++ standard recommends that the value returned should be a default constructed std::source_location object or a value identifying the violated contract assertion:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4