bool copy_file(const path& from, const path& to);
bool copy_file(const path& from, const path& to, error_code& ec) noexcept;
Returns: copy_file(from, to, copy_options::none) or
copy_file(from, to, copy_options::none, ec), respectively.
Throws: As specified in [fs.err.report].
bool copy_file(const path& from, const path& to, copy_options options);
bool copy_file(const path& from, const path& to, copy_options options,
error_code& ec) noexcept;
Requires: At most one element from each option group ([fs.enum.copy.opts]) is set in options.
Effects: As follows:
Report a file already exists error as specified in [fs.err.report] if:
!is_regular_file(from), or
exists(to) and !is_regular_file(to), or
exists(to) and equivalent(from, to), or
exists(to) and
(options & (copy_options::skip_existing | copy_options::overwrite_existing | copy_options::update_existing)) == copy_options::none
Otherwise, copy the contents and attributes of the file from resolves to, to the file to resolves to, if:
!exists(to), or
(options & copy_options::overwrite_existing) != copy_options::none, or
(options & copy_options::update_existing) != copy_options::none and from is more recent than to, determined as if by use of the last_write_time function ([fs.op.last_write_time]).
Otherwise, no effects.
Returns: true if the from file was copied, otherwise false. The signature with argument ec returns false if an error occurs.
Throws: As specified in [fs.err.report].