C++ åèæå
- C++11
- C++14
- C++17
- C++20
- C++ ç¼è¯å¨æ¯ææ åµè¡¨
- ç¬ç«ä¸å®¿ä¸»å®ç°
- C++ è¯è¨
- C++ å ³é®è¯
- é¢å¤çå¨
- C++ æ ååºå¤´æä»¶
- å ·åè¦æ±
- åè½ç¹æ§æµè¯ (C++20)
- å·¥å ·åº
- ç±»åæ¯æï¼åºæ¬ç±»åãRTTIãç±»åç¹æ§ï¼
- æ¦å¿µåº (C++20)
- é误å¤ç
- std::exception_ptr
- std::error_code
- std::error_condition
- std::terminate
- std::exception
- std::current_exception
- std::rethrow_exception
- std::make_exception_ptr
- std::unexpected
- std::uncaught_exception, std::uncaught_exceptions
- assert
- errno
- std::nested_exception
- std::throw_with_nested
- std::rethrow_if_nested
- std::terminate_handler
- std::get_terminate
- std::set_terminate
- std::bad_exception
- std::unexpected_handler
- std::get_unexpected
- std::set_unexpected
- é误å·
- std::logic_error
- std::invalid_argument
- std::domain_error
- std::length_error
- std::out_of_range
- std::runtime_error
- std::range_error
- std::overflow_error
- std::underflow_error
- std::tx_exception
- std::error_category
- std::generic_category
- std::system_category
- std::errc
- std::make_error_code(std::errc)
- std::make_error_condition(std::errc)
- std::system_error
- 注é
- 卿å å管ç
- æ¥æåæ¶é´å·¥å ·
- å符串åº
- 容å¨åº
- è¿ä»£å¨åº
- èå´åº (C++20)
- ç®æ³åº
- æ°å¼åº
- è¾å ¥/è¾åºåº
- æä»¶ç³»ç»åº
- æ¬å°ååº
- æ£å表达å¼åº
- ååæä½åº
- çº¿ç¨æ¯æåº
- å®éªæ§ C++ ç¹æ§
- æç¨çèµæº
- ç´¢å¼
- std 符å·ç´¢å¼
- åç¨æ¯æ (C++20)
- C++ å ³é®è¯
ä½ç½®ï¼é¦é¡µ > C++ åèæå >é误å¤ç > std::errc
std::errc
| å®ä¹äºå¤´æä»¶ <system_error>
|
||
| enum class errc; |
(C++11 èµ·) | |
æä½ç¨åæä¸¾ std::errc å®ä¹å¯¹åº POSIX é误ç çå¯ç§»æ¤é误æ¡ä»¶ã
æå常é
| Â | |
| 常é | çä»·ç POSIX é误 |
address_family_not_supported
|
EAFNOSUPPORT |
address_in_use
|
EADDRINUSE |
address_not_available
|
EADDRNOTAVAIL |
already_connected
|
EISCONN |
argument_list_too_long
|
E2BIG |
argument_out_of_domain
|
EDOM |
bad_address
|
EFAULT |
bad_file_descriptor
|
EBADF |
bad_message
|
EBADMSG |
broken_pipe
|
EPIPE |
connection_aborted
|
ECONNABORTED |
connection_already_in_progress
|
EALREADY |
connection_refused
|
ECONNREFUSED |
connection_reset
|
ECONNRESET |
cross_device_link
|
EXDEV |
destination_address_required
|
EDESTADDRREQ |
device_or_resource_busy
|
EBUSY |
directory_not_empty
|
ENOTEMPTY |
executable_format_error
|
ENOEXEC |
file_exists
|
EEXIST |
file_too_large
|
EFBIG |
filename_too_long
|
ENAMETOOLONG |
function_not_supported
|
ENOSYS |
host_unreachable
|
EHOSTUNREACH |
identifier_removed
|
EIDRM |
illegal_byte_sequence
|
EILSEQ |
inappropriate_io_control_operation
|
ENOTTY |
interrupted
|
EINTR |
invalid_argument
|
EINVAL |
invalid_seek
|
ESPIPE |
io_error
|
EIO |
is_a_directory
|
EISDIR |
message_size
|
EMSGSIZE |
network_down
|
ENETDOWN |
network_reset
|
ENETRESET |
network_unreachable
|
ENETUNREACH |
no_buffer_space
|
ENOBUFS |
no_child_process
|
ECHILD |
no_link
|
ENOLINK |
no_lock_available
|
ENOLCK |
no_message_available
|
ENODATA |
no_message
|
ENOMSG |
no_protocol_option
|
ENOPROTOOPT |
no_space_on_device
|
ENOSPC |
no_stream_resources
|
ENOSR |
no_such_device_or_address
|
ENXIO |
no_such_device
|
ENODEV |
no_such_file_or_directory
|
ENOENT |
no_such_process
|
ESRCH |
not_a_directory
|
ENOTDIR |
not_a_socket
|
ENOTSOCK |
not_a_stream
|
ENOSTR |
not_connected
|
ENOTCONN |
not_enough_memory
|
ENOMEM |
not_supported
|
ENOTSUP |
operation_canceled
|
ECANCELED |
operation_in_progress
|
EINPROGRESS |
operation_not_permitted
|
EPERM |
operation_not_supported
|
EOPNOTSUPP |
operation_would_block
|
EWOULDBLOCK |
owner_dead
|
EOWNERDEAD |
permission_denied
|
EACCES |
protocol_error
|
EPROTO |
protocol_not_supported
|
EPROTONOSUPPORT |
read_only_file_system
|
EROFS |
resource_deadlock_would_occur
|
EDEADLK |
resource_unavailable_try_again
|
EAGAIN |
result_out_of_range
|
ERANGE |
state_not_recoverable
|
ENOTRECOVERABLE |
stream_timeout
|
ETIME |
text_file_busy
|
ETXTBSY |
timed_out
|
ETIMEDOUT |
too_many_files_open_in_system
|
ENFILE |
too_many_files_open
|
EMFILE |
too_many_links
|
EMLINK |
too_many_symbolic_link_levels
|
ELOOP |
value_too_large
|
EOVERFLOW |
wrong_protocol_type
|
EPROTOTYPE |
éæå彿°
| (C++11) |
æé std::errc é误ç (彿°) |
| æé std::errc é误æ¡ä»¶ (彿°) |
帮å©ç±»
| æ©å
std::is_error_condition_enum ç±»åç¹æ§ä»¥é´å« std::errc å¼ä¸º error_condition (彿°æ¨¡æ¿) |
示ä¾
è¿è¡æ¤ä»£ç
#include <iostream> #include <system_error> #include <thread> int main() { try { std::thread().detach(); // è±éä¸ä¸ªéçº¿ç¨ } catch (const std::system_error& e) { std::cout << "Caught a system_error\n"; if(e.code() == std::errc::invalid_argument) std::cout << "The error condition is std::errc::invalid_argument\n"; std::cout << "the error description is " << e.what() << '\n'; } }
è¾åºï¼
Caught a system_error The error condition is std::errc::invalid_argument the error description is Invalid argument
åé
| (C++11) |
ä¿æä¾èµäºå¹³å°çé误ç (ç±») |
| (C++11) |
ä¿æå¯ç§»æ¤çé误ç (ç±») |