Espaços nominais
Variantes
Acções

std::bad_function_call

Da cppreference.com
< cpp‎ | utility‎ | functional

 
 
Biblioteca de utilitários
Digite apoio (basic types, RTTI, type traits)
Gerenciamento de memória dinâmica
De tratamento de erros
Utilidades do programa
Variadic funções
Data e hora
Objetos de função
(C++11)
Os operadores relacionais
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Pares e tuplas
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
Troque, avançar e avançar
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
 
Objetos de função


Invólucros de função
Original:
Function wrappers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
bad_function_call
(C++11)
Ligar
Original:
Bind
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
Invólucros de referência
Original:
Reference wrappers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)(C++11)
Invólucros operador
Original:
Operator wrappers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Negadores
Original:
Negators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Obsoleta ligantes e adaptadores
Original:
Deprecated binders and adaptors
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(obsoleta)
(obsoleta)
(obsoleta)
(obsoleta)
(obsoleta)(obsoleta)(obsoleta)(obsoleta)
(obsoleta)
(obsoleta)(obsoleta)
(obsoleta)(obsoleta)
 
Definido no cabeçalho <functional>
class bad_function_call;
(desde 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/exceptionstd-bad function call-inheritance.svg
Sobre esta imagem

Inheritance diagram

Índice

[editar] Funções de membro

(constructor)
bad_function_call()
(função pública membro)

std::bad_function_call::bad_function_call()

bad_function_call();

Constructs a new instance of std::bad_function_call.

Parameters

(none)

Exceptions

noexcept specification:  
noexcept
  (desde C++11)

Herdado de std::exception

Member functions

[virtual]
destrói o objeto de exceção
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 função pública virtual membro) [edit]
[virtual]
retorna uma cadeia explicativa
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 função pública virtual membro) [edit]

[editar] Exemplo

#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';
    }
}

Saída:

bad function call

[editar] Veja também

(C++11)
envolve objeto que pode ser chamado de qualquer tipo com a assinatura especificada função chamada
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.

(modelo de classe) [edit]