Namespaces
Variants

std::contracts:: invoke_default_contract_violation_handler

From cppreference.net
Utilities library
Contract support
Contract-violation information
Helper functions
invoke_default_contract_violation_handler
(C++26)
ヘッダーで定義 <contracts>
void invoke_default_contract_violation_handler
( const std :: contracts :: contract_violation & violation ) ;
(C++26以降)

デフォルトの 契約違反ハンドラ violation を引数として呼び出します。

パラメータ

violation - 現在処理中の契約違反情報を保持するオブジェクト

注記

std::contracts::contract_violation 型のオブジェクトはユーザーが構築またはコピーできないため、この関数はユーザー定義の契約違反ハンドラの実行中にのみ呼び出すことができます。このとき violation は、ユーザー定義ハンドラのパラメータと同じオブジェクトを参照します。

この関数は、ユーザーが何らかのカスタムアクション(追加のロギングなど)を実行した後、デフォルトの契約違反ハンドラにフォールバックしたい場合に有用です。