public member function
<system_error>
std::error_code::assign
void assign (int val, const error_category& cat) noexcept;
Assign error code
The assignment operator (=) can be used to assign a new value to the error_code object by using an enum value instead.
Parameters
- val
- A numerical value identifying an error code.
- cat
- A reference to an error_category object.
Return value
noneExample
|
|
Possible output:
9 No error inf Result too large
See also
- error_code::error_code
- Construct error_code (public member function)
- error_code::operator=
- Assign error code (public member function)
- error_code::clear
- Clear error code (public member function)