[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:
David Zarzycki 2018-03-29 16:51:28 +00:00
parent db0f2f68b0
commit b458329327
1 changed files with 6 additions and 9 deletions

View File

@ -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;