std::bad_function_call
De cppreference.com
< cpp | utility | functional
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
Déclaré dans l'en-tête <functional>
|
||
class bad_function_call; |
(depuis C++11) | |
std::bad_function_call
is the type of the exception thrown by std::function::operator()
if the function wrapper has no target.
Sommaire |
[modifier] Fonctions membres
(constructeur) |
bad_function_call() (fonction membre publique) |
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
[ virtuel ]Original: virtual The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Détruit l'objet exception 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. (function membre virtuelle publique de std::exception )
|
[ virtuel ]Original: virtual The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
retourne une chaîne explicative 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. (function membre virtuelle publique de std::exception )
|
[modifier] Exemple
#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'; } }
Résultat :
bad function call
[modifier] Voir aussi
(C++11) |
adaptateur générique de foncteur (classe générique) |