path = p;
}
- _Dir(posix::DIR* dirp, const path& p) : _Dir_base(dirp), path(p) { }
+ _Dir(_Dir_base&& d, const path& p) : _Dir_base(std::move(d)), path(p) { }
_Dir(_Dir&&) = default;
_Dir_base d(dirfd, pathname, skip_permission_denied, nofollow, ec);
// If this->path is empty, the new _Dir should have an empty path too.
const fs::path& p = this->path.empty() ? this->path : this->entry.path();
- return _Dir(std::exchange(d.dirp, nullptr), p);
+ return _Dir(std::move(d), p);
}
bool
struct _Dir_base
{
- _Dir_base(posix::DIR* dirp = nullptr) : dirp(dirp) { }
-
// If no error occurs then dirp is non-null,
// otherwise null (even if a permission denied error is ignored).
_Dir_base(int fd, const posix::char_type* pathname,
path = p;
}
- _Dir(posix::DIR* dirp, const path& p) : _Dir_base(dirp), path(p) { }
+ _Dir(_Dir_base&& d, const path& p) : _Dir_base(std::move(d)), path(p) { }
_Dir(_Dir&&) = default;
{
auto [dirfd, pathname] = dir_and_pathname();
_Dir_base d(dirfd, pathname, skip_permission_denied, nofollow, ec);
- return _Dir(std::exchange(d.dirp, nullptr), entry.path());
+ return _Dir(std::move(d), entry.path());
}
fs::path path;