fix(libstore/path-info): make ValidPathInfo move constructible/assignable

This commit is contained in:
Sergei Zimmerman 2024-11-08 20:43:58 +03:00
parent 149802b9f5
commit 0347bca15b

View file

@ -176,17 +176,18 @@ struct ValidPathInfo : UnkeyedValidPathInfo {
*/ */
Strings shortRefs() const; Strings shortRefs() const;
ValidPathInfo(const ValidPathInfo & other) = default;
ValidPathInfo(StorePath && path, UnkeyedValidPathInfo info) : UnkeyedValidPathInfo(info), path(std::move(path)) { }; ValidPathInfo(StorePath && path, UnkeyedValidPathInfo info) : UnkeyedValidPathInfo(info), path(std::move(path)) { };
ValidPathInfo(const StorePath & path, UnkeyedValidPathInfo info) : UnkeyedValidPathInfo(info), path(path) { }; ValidPathInfo(const StorePath & path, UnkeyedValidPathInfo info) : UnkeyedValidPathInfo(info), path(path) { };
ValidPathInfo(const Store & store, ValidPathInfo(const Store & store,
std::string_view name, ContentAddressWithReferences && ca, Hash narHash); std::string_view name, ContentAddressWithReferences && ca, Hash narHash);
virtual ~ValidPathInfo() { }
}; };
static_assert(std::is_move_assignable_v<ValidPathInfo>);
static_assert(std::is_copy_assignable_v<ValidPathInfo>);
static_assert(std::is_copy_constructible_v<ValidPathInfo>);
static_assert(std::is_move_constructible_v<ValidPathInfo>);
using ValidPathInfos = std::map<StorePath, ValidPathInfo>; using ValidPathInfos = std::map<StorePath, ValidPathInfo>;
} }