std::bad_function_call
Aus cppreference.com
<metanoindex/>
<tbody> </tbody>| definiert in Header <functional>
|
||
class bad_function_call; |
(seit C++11) | |
std::bad_function_call is the type of the exception thrown by std::function::operator() if the function wrapper has no target.
Inheritance diagram
Member-Funktionen
(constructor) |
bad_function_call() (öffentliche Elementfunktion) |
std::bad_function_call::bad_function_call()
<tbody> </tbody> bad_function_call(); |
||
Constructs a new instance of std::bad_function_call.
Parameters
(none)
Exceptions
Inherited from std::exception
Member functions
[virtuell] |
Zerstört das Ausnahme-Objekt 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. (virtuellen öffentlichen Member-Funktion of std::exception)
|
[virtuell] |
gibt einen erläuternden String 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. (virtuellen öffentlichen Member-Funktion of std::exception)
|
Beispiel
#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';
}
}
Output:
bad function call
