public member function
<system_error>
std::error_condition::error_condition (1)error_condition() noexcept;(2)
error_condition (int val, const error_category& cat) noexcept;(3)
template <class ErrorConditionEnum> error_condition (ErrorConditionEnum e) noexcept;
Construct error_condition
Constructs an error_condition object:0
of the generic_category (associated with lack of error).
is_error_condition_enum<ErrorConditionEnum>::value
is true
. Which is the case when errc is used as the ErrorConditionEnum type.
true
.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// error_condition::error_condition
#include <iostream> // std::cout, std::ios
#include <system_error> // std::error_condition, std::generic_category
int main() {
std::cout << "The default error condition: ";
std::cout << std::error_condition().message() << '\n';
std::cout << "A condition constructed from errc: ";
std::cout << std::error_condition(std::errc::permission_denied).message() << '\n';
std::cout << "Some generic error conditions, by value:\n";
for (int i=0; i<10; ++i) {
std::error_condition c (i,std::generic_category());
std::cout << "\t#" << i << ": " << c.message() << '\n';
}
return 0;
}
The default error condition: No error A condition constructed from errc: Permission denied Some generic error conditions, by value: #0: No error #1: Operation not permitted #2: No such file or directory #3: No such process #4: Interrupted function call #5: Input/output error #6: No such device or address #7: Arg list too long #8: Exec format error #9: Bad file descriptor
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