std::bad_function_call
提供: cppreference.com
<tbody>
</tbody>

| ヘッダ <functional> で定義
|
||
class bad_function_call; |
(C++11以上) | |
std::bad_function_call は関数ラッパーがターゲットを持たない場合に std::function::operator() によって投げられる例外の型です。
継承図
目次
メンバ関数
| bad_function_call オブジェクトを構築します (パブリックメンバ関数) |
std::bad_function_call::bad_function_call()
<tbody> </tbody> bad_function_call() noexcept; |
||
std::bad_function_call の新しいインスタンスを構築します。
引数
(なし)
std::exception から継承
メンバ関数
[仮想] |
例外オブジェクトを破棄します ( std::exceptionの仮想パブリックメンバ関数)
|
[仮想] |
説明文字列を返します ( std::exceptionの仮想パブリックメンバ関数)
|
Example
Run this code
#include <iostream>
#include <functional>
int main()
{
std::function<int()> f = nullptr;
try {
f();
} catch(const std::bad_function_call& e) {
std::cout << e.what() << '\n';
}
}
出力例:
bad function call
関連項目
(C++11) |
指定された関数呼び出しシグネチャを持つ任意の型の呼び出し可能なオブジェクトをラップします (クラステンプレート) |