Namespaces
Variants
Actions

Standard library header <contracts> (C++26)

From cppreference.com
< cpp‎ | header
 
 
Standard library headers
 

This header is part of the language support library.

Defined in namespace std::contracts
the kind of the contract assertion violated
(enum) [edit]
the evaluation semantic when the contract violation occurs
(enum) [edit]
the reason that causes the contract violation
(enum) [edit]
the type holding the contract-violation information
(class) [edit]

Functions

Defined in namespace std::contracts
invokes the default contract-violation handler
(function) [edit]

[edit] Synopsis

// all freestanding
namespace std::contracts {
 
 enum class assertion_kind : /* unspecified */ {
 pre = 1,
 post = 2,
 assert = 3
 };
 
 enum class evaluation_semantic : /* unspecified */ {
 ignore = 1,
 observe = 2,
 enforce = 3,
 quick_enforce = 4
 };
 
 enum class detection_mode : /* unspecified */ {
 predicate_false = 1,
 evaluation_exception = 2
 };
 
 // class contract_violation
 class contract_violation;
 
 void invoke_default_contract_violation_handler(const contract_violation&);
}

[edit] Class std::contracts::contract_violation

namespace std::contracts {
 class contract_violation
 {
 // no user−accessible constructor
 public:
 contract_violation(const contract_violation&) = delete;
 contract_violation& operator=(const contract_violation&) = delete;
 /* see description */ ~contract_violation();
 const char* comment() const noexcept;
 contracts::detection_mode detection_mode() const noexcept;
 exception_ptr evaluation_exception() const noexcept;
 bool is_terminating() const noexcept;
 assertion_kind kind() const noexcept;
 source_location location() const noexcept;
 evaluation_semantic semantic() const noexcept;
 };
}
Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/header/contracts&oldid=181862"

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