std::bad_function_call
提供: cppreference.com
< cpp | utility | functional
ヘッダ <functional> で定義
|
||
class bad_function_call; |
(C++11以上) | |
std::bad_function_call
は関数ラッパーがターゲットを持たない場合に std::function::operator()
によって投げられる例外の型です。
目次 |
[編集] メンバ関数
コンストラクタ |
bad_function_call オブジェクトを構築します (パブリックメンバ関数) |
std::bad_function_call::bad_function_call()
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) |
指定された関数呼び出しシグネチャを持つ任意の型の呼び出し可能なオブジェクトをラップします (クラステンプレート) |