1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-05 00:21:01 +01:00

AutoDelete: Add move constructor

This commit is contained in:
Eelco Dolstra 2025-11-27 17:43:48 +01:00
parent 890a4e980a
commit 34e92724d6

View file

@ -293,8 +293,16 @@ class AutoDelete
bool recursive;
public:
AutoDelete();
AutoDelete(AutoDelete && x)
{
_path = std::move(x._path);
del = x.del;
recursive = x.recursive;
x.del = false;
}
AutoDelete(const std::filesystem::path & p, bool recursive = true);
AutoDelete(AutoDelete &&) = delete;
AutoDelete(const AutoDelete &) = delete;
AutoDelete & operator=(AutoDelete &&) = delete;
AutoDelete & operator=(const AutoDelete &) = delete;