◐ Shell
clean mode source ↗

std::bad_function_call - cppreference.com

Da cppreference.com.

Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.

La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui.

Click here for the English version of this page

<metanoindex/>

<tbody> </tbody>

Elemento definito nell'header

<functional>

class bad_function_call;

(dal C++11)

std::bad_function_call is the type of the exception thrown by std::function::operator() if the function wrapper has no target.

cpp/error/exception

Inheritance diagram

Membri funzioni

bad_function_call()
(metodo pubblico)

std::bad_function_call::bad_function_call()

<tbody> </tbody>

Constructs a new instance of std::bad_function_call.

Parameters

(none)

Exceptions

Inherited from std::exception

Member functions

distrugge l'oggetto eccezione

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.


(metodo pubblico virtuale) [modifica]

restituisce una stringa esplicativa

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.


(metodo pubblico virtuale) [modifica]

Esempio

#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:

Vedi anche

avvolge oggetto invocabile di qualsiasi tipo con la firma specificato chiamata di funzione

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.


(classe template) [modifica]