std::bad_function_call
提供: cppreference.com
< cpp | utility | functional
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
Defined in header <functional>
|
||
class bad_function_call; |
(C++11およびそれ以降) | |
std::bad_function_call
is the type of the exception thrown by std::function::operator()
if the function wrapper has no target.
目次 |
[編集] メンバ関数
(constructor) |
bad_function_call() (パブリックメンバ関数) |
std::bad_function_call::bad_function_call()
bad_function_call(); |
||
Constructs a new instance of std::bad_function_call
.
Parameters
(none)
Exceptions
Inherited from std::exception
Member functions
[仮想] |
例外オブジェクトを破棄します Original: destructs the exception object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想パブリックメンバ関数of std::exception )
|
[仮想] |
説明文字列を返します Original: returns an explanatory string The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (仮想パブリックメンバ関数of std::exception )
|
[編集] 例
このコードを実行します
#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) |
指定された関数呼び出しシグネチャを持つ任意の型の呼び出し可能オブジェクトをラップします Original: wraps callable object of any type with specified function call signature The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラステンプレート) |