19 Diagnostics library [diagnostics]

19.5 System error support [syserr]

19.5.7 Class system_­error [syserr.syserr]

19.5.7.2 Members [syserr.syserr.members]

system_error(error_code ec, const string& what_arg);
Postconditions: code() == ec and
string_­view(what()).find(what_­arg.c_­str()) != string_­view​::​npos.
system_error(error_code ec, const char* what_arg);
Postconditions: code() == ec and string_­view(what()).find(what_­arg) != string_­view​::​npos.
system_error(error_code ec);
Postconditions: code() == ec.
system_error(int ev, const error_category& ecat, const string& what_arg);
Postconditions: code() == error_­code(ev, ecat) and
string_­view(what()).find(what_­arg.c_­str()) != string_­view​::​npos.
system_error(int ev, const error_category& ecat, const char* what_arg);
Postconditions: code() == error_­code(ev, ecat) and
string_­view(what()).find(what_­arg) != string_­view​::​npos.
system_error(int ev, const error_category& ecat);
Postconditions: code() == error_­code(ev, ecat).
const error_code& code() const noexcept;
Returns: ec or error_­code(ev, ecat), from the constructor, as appropriate.
const char* what() const noexcept override;
Returns: An ntbs incorporating the arguments supplied in the constructor.
[Note
:
The returned ntbs might be the contents of what_­arg + ": " + code.message().
— end note
]