mirror of
https://github.com/NixOS/nix.git
synced 2025-11-14 14:32:42 +01:00
Merge pull request #11843 from xokdvium/dev/move-fixes
fix(treewide): clean up move semantics
This commit is contained in:
commit
aa9c0bc1ee
9 changed files with 15 additions and 17 deletions
|
|
@ -298,6 +298,10 @@ struct BasicDerivation
|
|||
std::string name;
|
||||
|
||||
BasicDerivation() = default;
|
||||
BasicDerivation(BasicDerivation &&) = default;
|
||||
BasicDerivation(const BasicDerivation &) = default;
|
||||
BasicDerivation& operator=(BasicDerivation &&) = default;
|
||||
BasicDerivation& operator=(const BasicDerivation &) = default;
|
||||
virtual ~BasicDerivation() { };
|
||||
|
||||
bool isBuiltin() const;
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ struct curlFileTransfer : public FileTransfer
|
|||
template<class T>
|
||||
void fail(T && e)
|
||||
{
|
||||
failEx(std::make_exception_ptr(std::move(e)));
|
||||
failEx(std::make_exception_ptr(std::forward<T>(e)));
|
||||
}
|
||||
|
||||
LambdaSink finalSink;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ Machine::Machine(
|
|||
systemTypes(systemTypes),
|
||||
sshKey(sshKey),
|
||||
maxJobs(maxJobs),
|
||||
speedFactor(speedFactor == 0.0f ? 1.0f : std::move(speedFactor)),
|
||||
speedFactor(speedFactor == 0.0f ? 1.0f : speedFactor),
|
||||
supportedFeatures(supportedFeatures),
|
||||
mandatoryFeatures(mandatoryFeatures),
|
||||
sshPublicHostKey(sshPublicHostKey)
|
||||
|
|
|
|||
|
|
@ -176,17 +176,18 @@ struct ValidPathInfo : UnkeyedValidPathInfo {
|
|||
*/
|
||||
Strings shortRefs() const;
|
||||
|
||||
ValidPathInfo(const ValidPathInfo & other) = default;
|
||||
|
||||
ValidPathInfo(StorePath && path, UnkeyedValidPathInfo info) : UnkeyedValidPathInfo(info), path(std::move(path)) { };
|
||||
ValidPathInfo(const StorePath & path, UnkeyedValidPathInfo info) : UnkeyedValidPathInfo(info), path(path) { };
|
||||
|
||||
ValidPathInfo(const Store & store,
|
||||
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>;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue