Changeset 4fba7ad in mainline
- Timestamp:
- 2018-07-05T21:41:23Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4dfac1e
- Parents:
- a1c35cc
- git-author:
- Dzejrou <dzejrou@…> (2018-05-14 19:27:36)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
- Location:
- uspace/lib/cpp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/system_error.hpp
ra1c35cc r4fba7ad 31 31 32 32 #include <internal/aux.hpp> 33 #include <internal/stringfwd.hpp> 33 34 #include <stdexcept> 34 35 … … 340 341 const error_code& code() const noexcept; 341 342 342 const char* what() const noexcept override;343 344 343 private: 345 344 error_code code_; 346 string what_;347 345 }; 348 346 -
uspace/lib/cpp/src/system_error.cpp
ra1c35cc r4fba7ad 27 27 */ 28 28 29 #include <cstring> 29 30 #include <functional> 30 31 #include <string> … … 263 264 264 265 system_error::system_error(error_code ec, const string& what_arg) 265 : code_{ec}, what_{what_arg}266 : runtime_error{what_arg.c_str()}, code_{ec} 266 267 { /* DUMMY BODY */ } 267 268 268 269 system_error::system_error(error_code ec, const char* what_arg) 269 : code_{ec}, what_{what_arg}270 : runtime_error{what_arg}, code_{ec} 270 271 { /* DUMMY BODY */ } 271 272 272 273 system_error::system_error(error_code ec) 273 : code_{ec}, what_{}274 : runtime_error{"system_error"}, code_{ec} 274 275 { /* DUMMY BODY */ } 275 276 276 277 system_error::system_error(int code, const error_category& cat, 277 278 const string& what_arg) 278 : code_{code, cat}, what_{what_arg}279 : runtime_error{what_arg.c_str()}, code_{code, cat} 279 280 { /* DUMMY BODY */ } 280 281 281 282 system_error::system_error(int code, const error_category& cat, 282 283 const char* what_arg) 283 : code_{code, cat}, what_{what_arg}284 : runtime_error{what_arg}, code_{code, cat} 284 285 { /* DUMMY BODY */ } 285 286 286 287 system_error::system_error(int code, const error_category& cat) 287 : code_{code, cat}, what_{}288 : runtime_error{"system_error"}, code_{code, cat} 288 289 { /* DUMMY BODY */ } 289 290 … … 292 293 return code_; 293 294 } 294 295 const char* system_error::what() const noexcept296 {297 return what_.c_str();298 }299 295 }
Note:
See TracChangeset
for help on using the changeset viewer.