From fde2ad1de61239ff87a64239660e42bcc5311146 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Fri, 7 Apr 2023 22:40:03 +0200 Subject: [PATCH] system_error: Optimize internal class _System_error --- stl/inc/system_error | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stl/inc/system_error b/stl/inc/system_error index 04e227fc53..42b2ab7090 100644 --- a/stl/inc/system_error +++ b/stl/inc/system_error @@ -473,6 +473,8 @@ private: } protected: + _System_error(error_code _Errcode) : runtime_error(_Errcode.message()), _Mycode(_Errcode) {} + _System_error(error_code _Errcode, const string& _Message) : runtime_error(_Makestr(_Errcode, _Message)), _Mycode(_Errcode) {} @@ -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) {}