Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<system_error>: Optimize internal class _System_error #3635

Merged
merged 1 commit into from
Apr 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions stl/inc/system_error
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ private:
}

protected:
_System_error(error_code _Errcode) : runtime_error(_Errcode.message()), _Mycode(_Errcode) {}
diamante0018 marked this conversation as resolved.
Show resolved Hide resolved

_System_error(error_code _Errcode, const string& _Message)
: runtime_error(_Makestr(_Errcode, _Message)), _Mycode(_Errcode) {}

Expand All @@ -484,13 +486,13 @@ private:
using _Mybase = _System_error;

public:
system_error(error_code _Errcode) : _Mybase(_Errcode, "") {}
system_error(error_code _Errcode) : _Mybase(_Errcode) {}

system_error(error_code _Errcode, const string& _Message) : _Mybase(_Errcode, _Message) {}

system_error(error_code _Errcode, const char* _Message) : _Mybase(_Errcode, _Message) {}

system_error(int _Errval, const error_category& _Errcat) : _Mybase(error_code(_Errval, _Errcat), "") {}
system_error(int _Errval, const error_category& _Errcat) : _Mybase(error_code(_Errval, _Errcat)) {}

system_error(int _Errval, const error_category& _Errcat, const string& _Message)
: _Mybase(error_code(_Errval, _Errcat), _Message) {}
Expand Down