Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/error/errc/make error code"

From cppreference.com
< cpp‎ | error‎ | errc
m (r2.7.3) (Robot: Adding de, es, fr, it, ja, pt, ru, zh)
m (fmt)
 
(12 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{cpp/error/error_code/title|make_error_code}}
+
{{cpp/title|make_error_code{{small|(std::errc)}}}}
{{cpp/error/error_code/navbar}}
+
{{cpp/error/errc/navbar}}
{{ddcl | header=system_error | notes={{mark since c++11}} | 1=
+
{{ddcl|header=system_error|since=c++11|1=
error_code make_error_code( std::errc e );
+
std::error_code make_error_code( std::errc e ) noexcept;
 
}}
 
}}
  
Creates error code value for errc enum {{tt|e}}.
+
Creates error code value for {{tt|errc}} enum {{c|e}}.
  
Equivalent to {{c|error_code(static_cast<int>(e), generic_category())}}
+
Equivalent to {{c|std::error_code(static_cast<int>(e), std::generic_category())}}
  
 
===Parameters===
 
===Parameters===
{{param list begin}}
+
{{par begin}}
{{param list item | e | error code enum to create error code for}}
+
{{par|e|error code enum to create error code for}}
{{param list end}}
+
{{par end}}
  
 
===Return value===
 
===Return value===
Error code corresponding to {{tt|e}}.
+
Error code corresponding to {{c|e}}.
  
===Exceptions===
+
===See also===
{{noexcept}}
+
{{dsc begin}}
 +
{{dsc inc|cpp/io/io_errc/dsc make_error_code}}
 +
{{dsc inc|cpp/thread/future_errc/dsc make_error_code}}
 +
{{dsc end}}
  
[[de:cpp/error/error code/make error code]]
+
{{langlinks|es|ja|ru|zh}}
[[es:cpp/error/error code/make error code]]
+
[[fr:cpp/error/error code/make error code]]
+
[[it:cpp/error/error code/make error code]]
+
[[ja:cpp/error/error code/make error code]]
+
[[pt:cpp/error/error code/make error code]]
+
[[ru:cpp/error/error code/make error code]]
+
[[zh:cpp/error/error code/make error code]]
+

Latest revision as of 23:24, 30 August 2023

 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
 
std::errc
Non-member functions
make_error_code
Helper classes
 
Defined in header <system_error>
std::error_code make_error_code( std::errc e ) noexcept;
(since C++11)

Creates error code value for errc enum e.

Equivalent to std::error_code(static_cast<int>(e), std::generic_category())

[edit] Parameters

e - error code enum to create error code for

[edit] Return value

Error code corresponding to e.

[edit] See also

constructs an iostream error code
(function) [edit]
constructs a future error code
(function) [edit]