Created on 2014-06-07.00:00:00 last changed 89 months ago
Proposed resolution:
This wording is relative to N4606.
Modify [fs.path.modifiers] as indicated:
path& remove_filename();-5-
-6- Returns: *this. -7- [Example:PostconditionEffects:!has_filename()If this->compare(root_path()) == 0, then clear(). Otherwise, *this = parent_path()..std::cout << path("/foo").remove_filename(); // outputs "/" std::cout << path("/").remove_filename(); // outputs ""— end example]
[ 2017-07, Toronto Thursday night issues processing ]
This was resolved by the adoption of P0492R2.
[ 2017-07-14, Davis Herring comments ]
Changes in P0492R2 changed remove_filename() and has_filename() in such a fashion that the postcondition is now satisfied. (In the example in the issue description, "/foo" does gets mapped to "/", but path("/").has_filename() is false.)
[ 2016-11-21, Beman comments ]
This issue is closely related to CD NB comments US 25, US 37, US 51, US 52, US 53, US 54, and US 60. The Filesystem SG in Issaquah recommended that these all be handled together, as they all revolve around the exact meaning of "filename" and path decomposition.
[ 2016-10-16, Eric reopens and provides improved wording ]
The suggested PR is incorrect. root_path() removes redundant directory separators.
Therefore the condition *this == root_path() will fail for "//foo///" because root_path() returns "//foo/". However using path::compare instead would solve this problem.[ 2016-08 Chicago ]
Wed AM: Move to Tentatively Ready
Previous resolution [SUPERSEDED]:
path& remove_filename();
Postcondition: !has_filename().Effects: If
*this == root_path()
, thenclear()
. Otherwise,*this = parent_path()
.Returns:
*this
.[Example:
std::cout << path("/foo").remove_filename();
// outputs "/
" std::cout << path("/").remove_
filename(); // outputs ""
—end example]
[ 2016-04, Issues Telecon ]
There was concern that the effects wording is not right. Jonathan provided updated wording.
Previous resolution [SUPERSEDED]:
path& remove_filename();
Postcondition:!has_filename()
.Effects:
*this = parent_path()
, except that ifparent_path() == root_path()
,clear()
.Returns:
*this
.[Example:
std::cout << path("/foo").remove_filename();
// outputs "/
" std::cout << path("/").remove_
filename(); // outputs ""—end example]
[ 2016-04 Issue updated to address the C++ Working Paper. Previously addressed File System TS ]
[ 2014-06-17 Rapperswil LWG will investigate issue at a subsequent meeting. ]
[ 2014-06-08 Beman supplies an Effects: element. ]
remove_filename()
specifies !has_filename()
as the post condition.
This post condition is not correct. For example the path "/foo"
has a filename of "foo"
. If we remove the filename we get "/"
,
and "/"
has a filename of "/"
.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-17 16:58:47 | admin | set | messages: + msg9432 |
2017-07-16 20:11:05 | admin | set | messages: + msg9415 |
2017-07-16 20:11:05 | admin | set | status: open -> resolved |
2016-11-26 14:41:57 | admin | set | messages: + msg8683 |
2016-10-16 11:32:37 | admin | set | messages: + msg8568 |
2016-10-16 11:32:37 | admin | set | status: ready -> open |
2016-08-04 02:52:49 | admin | set | messages: + msg8379 |
2016-08-04 02:52:49 | admin | set | status: new -> ready |
2016-04-16 04:56:37 | admin | set | messages: + msg8061 |
2016-04-10 22:23:37 | admin | set | messages: + msg8039 |
2016-01-28 01:00:35 | admin | set | messages: + msg7921 |
2016-01-28 01:00:35 | admin | set | messages: + msg7920 |
2016-01-28 01:00:35 | admin | set | messages: + msg7919 |
2014-06-07 00:00:00 | admin | create |