class
<functional>
std::bad_function_callException thrown on bad call
Empty function objects are function objects with no target callable object.
This class is derived from exception. See the exception class for the member definitions of standard exceptions.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// bad_function_call example
#include <iostream> // std::cout
#include <functional> // std::function, std::plus, std::bad_function_call
int main () {
std::function<int(int,int)> foo = std::plus<int>();
std::function<int(int,int)> bar;
try {
std::cout << foo(10,20) << '\n';
std::cout << bar(10,20) << '\n';
}
catch (std::bad_function_call& e)
{
std::cout << "ERROR: Bad function call\n";
}
return 0;
}
30 ERROR: Bad function call
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4