Differences between c++14 std::experimental::filesystem::v1 and c++17 std::filesystem?

前端 未结 1 412
北恋
北恋 2021-01-17 22:16

I found this page, describing the changes between c++14 and c++17:

https://isocpp.org/files/papers/p0636r0.html

... It links to this page, which describes th

1条回答
  •  孤街浪徒
    2021-01-17 22:32

    The major papers making changes to the filesystem library are

    • P0219R1, adding relative paths support
    • P0317R1, adding caching to directory_entry
    • P0492R2, a lengthy list of fixes and changes in response to national body comments
    • P0430R2, support for certain non-POSIX systems

    There are also some relatively minor fixes and changes that can be found in the LWG issue list. Look for issues with "C++17" status. Note that some of these changes are then superseded by the papers listed above.


    For existing Filesystem TS code, I expect that P0492R2 is the one that matters the most, since the remaining papers are mostly feature additions rather than changes. P0492R2 includes both technical clarifications and significant semantic changes. Some in the latter category that immediately come to mind are:

    • path(".profile").stem() is now ".profile"
    • operator/ on path had its semantics changed significantly if the rhs is an absolute path or has a root-name. path("/foo") / "/bar" is now "/bar" rather than "/foo/bar"; path("C:\\x") / "D:y" on Windows is now "D:y".
    • The old absolute is gone. system_complete has been renamed absolute.
    • permissions's signature got a minor change.

    0 讨论(0)
提交回复
热议问题