mirror of
https://github.com/NixOS/nix.git
synced 2025-12-23 01:11:07 +01:00
treewide: Follow rule of five
Good to explicitly declare things to not accidentally do twice the work by preventing that kind of misuse. This is essentially just cppcoreguidelines-special-member-functions lint in clang-tidy.
This commit is contained in:
parent
8c74aadbf7
commit
54d2268d84
10 changed files with 68 additions and 14 deletions
|
|
@ -741,6 +741,11 @@ public:
|
|||
inDebugger = true;
|
||||
}
|
||||
|
||||
DebuggerGuard(DebuggerGuard &&) = delete;
|
||||
DebuggerGuard(const DebuggerGuard &) = delete;
|
||||
DebuggerGuard & operator=(DebuggerGuard &&) = delete;
|
||||
DebuggerGuard & operator=(const DebuggerGuard &) = delete;
|
||||
|
||||
~DebuggerGuard()
|
||||
{
|
||||
inDebugger = false;
|
||||
|
|
|
|||
|
|
@ -107,6 +107,8 @@ private:
|
|||
Bindings & operator=(const Bindings &) = delete;
|
||||
Bindings & operator=(Bindings &&) = delete;
|
||||
|
||||
~Bindings() = default;
|
||||
|
||||
friend class BindingsBuilder;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -164,8 +164,6 @@ public:
|
|||
Value ** elems;
|
||||
ListBuilder(EvalMemory & mem, size_t size);
|
||||
|
||||
// NOTE: Can be noexcept because we are just copying integral values and
|
||||
// raw pointers.
|
||||
ListBuilder(ListBuilder && x) noexcept
|
||||
: size(x.size)
|
||||
, inlineElems{x.inlineElems[0], x.inlineElems[1]}
|
||||
|
|
@ -173,6 +171,11 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
ListBuilder(const ListBuilder &) = delete;
|
||||
ListBuilder & operator=(ListBuilder &&) = delete;
|
||||
ListBuilder & operator=(const ListBuilder &) = delete;
|
||||
~ListBuilder() = default;
|
||||
|
||||
Value *& operator[](size_t n)
|
||||
{
|
||||
return elems[n];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue