filesystem::canonical()
still defined in terms of absolute(p, base)
Section: 31.12.13.3 [fs.op.canonical] Status: C++17 Submitter: Sergey Zubkov Opened: 2017-04-21 Last modified: 2020-09-06
Priority: 1
View all issues with C++17 status.
Discussion:
This is from editorial issue #1620:
Since the resolution of US-78 was applied (as part of P0492R2),std::filesystem::absolute(path, base)
no longer exists. However, std::filesystem::canonical
is still defined in terms of absolute(p, base)
.
[2017-06-27 P1 after 5 positive votes on c++std-lib]
Davis Herring: This needs to be P1 — due to a wording gap in P0492R2, 2 out of the
3 overloads of filesystem::canonical()
have bad signatures and are unimplementable.
[2017-07-14, Toronto, Davis Herring provides wording]
[2017-07-14, Toronto, Moved to Immediate]
Proposed resolution:
This wording is relative to N4659.
Edit 31.12.4 [fs.filesystem.syn] as indicated:
path canonical(const path& p, const path& base = current_path()); path canonical(const path& p, error_code& ec);path canonical(const path& p, const path& base, error_code& ec);
Edit 31.12.13.3 [fs.op.canonical] as indicated:
path canonical(const path& p, const path& base = current_path()); path canonical(const path& p, error_code& ec);path canonical(const path& p, const path& base, error_code& ec);-1- Effects: Converts
-2- Returns: A path that refers to the same file system object asp
, which must exist, to an absolute path that has no symbolic link, dot, or dot-dot elements in its pathname in the generic format.absolute(p
., base)For the overload without aThe signature with argumentbase
argument,base
iscurrent_path()
. Signaturesec
returnspath()
if an error occurs. […]