Created on 2018-05-10.00:00:00 last changed 45 months ago
Proposed resolution:
This wording is relative to N4727.
Drafting note: This contains a drive-by editorial change to use string_view for these postconditions rather than string.
Edit [syserr.syserr.members] p1-4 as indicated:
system_error(error_code ec, const string& what_arg);-1- Effects: Constructs an object of class system_error.
-2- Postconditions: code() == ec and string_view(what()).find(what_arg.c_str()) != string_view::npos.system_error(error_code ec, const char* what_arg);-3- Effects: Constructs an object of class system_error.
-4- Postconditions: code() == ec and string_view(what()).find(what_arg) != string_view::npos.
Edit [syserr.syserr.members] p7-10 as indicated:
system_error(int ev, const error_category& ecat, const std::string& what_arg);-7- Effects: Constructs an object of class system_error.
-8- 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);-9- Effects: Constructs an object of class system_error.
-10- Postconditions: code() == error_code(ev, ecat) and string_view(what()).find(what_arg) != string_view::npos.
Edit [fs.filesystem_error.members] p2-4 as indicated:
filesystem_error(const string& what_arg, error_code ec);-2- Postconditions:
- code() == ec,
- path1().empty() == true,
- path2().empty() == true, and
- string_view(what()).find(what_arg.c_str()) != string_view::npos.
filesystem_error(const string& what_arg, const path& p1, error_code ec);-3- Postconditions:
- code() == ec,
- path1() returns a reference to the stored copy of p1,
- path2().empty() == true, and
- string_view(what()).find(what_arg.c_str()) != string_view::npos.
filesystem_error(const string& what_arg, const path& p1, const path& p2, error_code ec);-4- Postconditions:
- code() == ec,
- path1() returns a reference to the stored copy of p1,
- path2() returns a reference to the stored copy of p2,
- string_view(what()).find(what_arg.c_str()) != string_view::npos.
[ 2019-01-20 Reflector prioritization ]
Set Priority to 0 and status to Tentatively Ready
The constructors of system_error and filesystem_error taking a std::string what_arg are specified to have a postcondition of string(what()).find(what_arg) != string::npos (or the equivalent with string_view). This is not possible if what_arg contains an embedded null character.
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2019-02-26 17:40:23 | admin | set | status: voting -> wp |
2019-01-21 04:50:04 | admin | set | status: ready -> voting |
2019-01-20 16:20:00 | admin | set | messages: + msg10288 |
2019-01-20 16:20:00 | admin | set | status: new -> ready |
2018-05-10 20:42:31 | admin | set | messages: + msg9850 |
2018-05-10 00:00:00 | admin | create |