2680. Add "Equivalent to" to filesystem

Section: 31.12 [filesystems] Status: C++17 Submitter: Beman Dawes Opened: 2016-04-15 Last modified: 2017-07-30

Priority: 2

View all other issues in [filesystems].

View all issues with C++17 status.

Discussion:

The IS project editors have requested that filesystem Effects elements specified purely as C++ code include the phrase "Equivalent to" if this is the intent. They do not consider this change to be editorial.

[2016-08 Chicago]

Wed AM: Move to Tentatively Ready

Proposed resolution:

31.12.6.5.5 [fs.path.modifiers]

path& replace_filename(const path& replacement);

Effects: Equivalent to:

remove_filename();
operator/=(replacement);

31.12.6.8 [fs.path.nonmember]

void swap(path& lhs, path& rhs) noexcept;

Effects: Equivalent to: lhs.swap(rhs)

31.12.6.7 [fs.path.io]

template <class charT, class traits>
basic_ostream<charT, traits>&
operator<<(basic_ostream<charT, traits>& os, const path& p);

Effects: Equivalent to: os << quoted(p.string<charT, traits>()).


31.12.6.7 [fs.path.io]

template <class charT, class traits>
basic_istream<charT, traits>&
operator>>(basic_istream<charT, traits>& is, path& p);

Effects: Equivalent to:

basic_string<charT, traits> tmp;
is >> quoted(tmp);
p = tmp;

31.12.13.4 [fs.op.copy]

void copy(const path& from, const path& to);
void copy(const path& from, const path& to, error_code& ec) noexcept;

Effects: Equivalent to: copy(from, to, copy_options::none) or copy(from, to, copy_options::none, ec), respectively.

[fs.op.copy_symlink]

void copy_symlink(const path& existing_symlink, const path& new_symlink);
void copy_symlink(const path& existing_symlink, const path& new_symlink,
  error_code& ec) noexcept;

Effects: Equivalent to: function(read_symlink(existing_symlink), new_symlink) or function(read_symlink(existing_symlink, ec), new_symlink, ec), respectively, where function is create_symlink or create_directory_symlink, as appropriate.