forked from OSchip/llvm-project
[ADT] NFC: Fix bogus StringSwitch rule-of-five boilerplate
Now that 'Str' is constant, the rule-of-file logic needs updating. Reported by: vit9696@avp.su Reviewed by: jordan_rose@apple.com llvm-svn: 328803
This commit is contained in:
parent
db0f2f68b0
commit
b458329327
|
@ -55,16 +55,13 @@ public:
|
|||
|
||||
// StringSwitch is not copyable.
|
||||
StringSwitch(const StringSwitch &) = delete;
|
||||
void operator=(const StringSwitch &) = delete;
|
||||
|
||||
StringSwitch(StringSwitch &&other) {
|
||||
*this = std::move(other);
|
||||
}
|
||||
StringSwitch &operator=(StringSwitch &&other) {
|
||||
Str = std::move(other.Str);
|
||||
Result = std::move(other.Result);
|
||||
return *this;
|
||||
}
|
||||
// StringSwitch is not assignable due to 'Str' being 'const'.
|
||||
void operator=(const StringSwitch &) = delete;
|
||||
void operator=(StringSwitch &&other) = delete;
|
||||
|
||||
StringSwitch(StringSwitch &&other)
|
||||
: Str(other.Str), Result(std::move(other.Result)) { }
|
||||
|
||||
~StringSwitch() = default;
|
||||
|
||||
|
|
Loading…
Reference in New Issue