#
The class 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 ([basic.contract.eval]).
Objects of this type can be created only by the implementation.
It is implementation-defined whether the destructor is virtual.
const char* comment() const noexcept;
2
Returns: An implementation-defined ntmbs in the ordinary literal encoding ([lex.charset]).
Recommended practice: 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.
[Note 1: 
The string can represent a truncated, reformatted, or summarized rendering of the predicate, before or after preprocessing.
— end note]
contracts::detection_mode detection_mode() const noexcept;
Returns: The enumerator value corresponding to the manner in which the contract violation was identified.
bool is_terminating() const noexcept;
Returns: true if the evaluation semantic is a terminating semantic ([basic.contract.eval]); otherwise, false.
assertion_kind kind() const noexcept;
Returns: The enumerator value corresponding to the syntactic form of the violated contract assertion.
source_location location() const noexcept;
Returns: A source_location object with implementation-defined value.
Recommended practice: The value returned should be a default constructed source_location object or a value identifying the violated contract assertion:
  • When possible, if the violated contract assertion was a precondition, the source location of the function invocation should be returned.
  • Otherwise, the source location of the contract assertion should be returned.
evaluation_semantic semantic() const noexcept;
Returns: The enumerator value corresponding to the evaluation semantic with which the violated contract assertion was evaluated.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant