Skip to content

Commit 18e31d4

Browse files
authored
Merge pull request #14682 from NixOS/autodelete-move
AutoDelete: Add move constructor
2 parents 890a4e9 + 0f4c720 commit 18e31d4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/libutil/include/nix/util/file-system.hh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,16 @@ class AutoDelete
293293
bool recursive;
294294
public:
295295
AutoDelete();
296+
297+
AutoDelete(AutoDelete && x) noexcept
298+
{
299+
_path = std::move(x._path);
300+
del = x.del;
301+
recursive = x.recursive;
302+
x.del = false;
303+
}
304+
296305
AutoDelete(const std::filesystem::path & p, bool recursive = true);
297-
AutoDelete(AutoDelete &&) = delete;
298306
AutoDelete(const AutoDelete &) = delete;
299307
AutoDelete & operator=(AutoDelete &&) = delete;
300308
AutoDelete & operator=(const AutoDelete &) = delete;

0 commit comments

Comments
 (0)