* include/bits/fs_ops.h (exists(const path&, error_code&))): Only
check status_known once.
* include/experimental/bits/fs_ops.h: Likewise.
From-SVN: r256243
2018-01-04 Jonathan Wakely <jwakely@redhat.com>
+ * include/bits/fs_ops.h (exists(const path&, error_code&))): Only
+ check status_known once.
+ * include/experimental/bits/fs_ops.h: Likewise.
+
PR libstdc++/83607
* include/std/functional (__is_byte_like): New trait.
(__is_std_equal_to): Remove.
{
auto __s = status(__p, __ec);
if (status_known(__s))
- __ec.clear();
- return exists(__s);
+ {
+ __ec.clear();
+ return __s.type() != file_type::not_found;
+ }
+ return false;
}
uintmax_t file_size(const path& __p);
{
auto __s = status(__p, __ec);
if (status_known(__s))
- __ec.clear();
- return exists(__s);
+ {
+ __ec.clear();
+ return __s.type() != file_type::not_found;
+ }
+ return false;
}
uintmax_t file_size(const path& __p);