1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-04 16:10:59 +01:00

Merge pull request #14682 from NixOS/autodelete-move

AutoDelete: Add move constructor
This commit is contained in:
Eelco Dolstra 2025-12-01 13:33:06 +00:00 committed by GitHub
commit 18e31d404b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -293,8 +293,16 @@ class AutoDelete
bool recursive;
public:
AutoDelete();
AutoDelete(AutoDelete && x) noexcept
{
_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;