diff options
| author | 2018-07-18 00:25:08 -0400 | |
|---|---|---|
| committer | 2018-07-18 00:25:12 -0400 | |
| commit | 3575d367a4aafa1810feab9ba1effbad11a57702 (patch) | |
| tree | 15a9b9c551b71af0db5560729d01428d0be73417 | |
| parent | Merge pull request #675 from Subv/stencil (diff) | |
| download | yuzu-3575d367a4aafa1810feab9ba1effbad11a57702.tar.gz yuzu-3575d367a4aafa1810feab9ba1effbad11a57702.tar.xz yuzu-3575d367a4aafa1810feab9ba1effbad11a57702.zip | |
telemetry: Default copy/move constructors and assignment operators
This provides the equivalent behavior, but without as much boilerplate.
While we're at it, explicitly default the move constructor, since we
have a move-assignment operator defined.
Diffstat (limited to '')
| -rw-r--r-- | src/common/telemetry.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/common/telemetry.h b/src/common/telemetry.h index 7a09df0a7..2c945443b 100644 --- a/src/common/telemetry.h +++ b/src/common/telemetry.h | |||
| @@ -58,21 +58,11 @@ public: | |||
| 58 | Field(FieldType type, std::string name, T&& value) | 58 | Field(FieldType type, std::string name, T&& value) |
| 59 | : name(std::move(name)), type(type), value(std::move(value)) {} | 59 | : name(std::move(name)), type(type), value(std::move(value)) {} |
| 60 | 60 | ||
| 61 | Field(const Field& other) : Field(other.type, other.name, other.value) {} | 61 | Field(const Field&) = default; |
| 62 | Field& operator=(const Field&) = default; | ||
| 62 | 63 | ||
| 63 | Field& operator=(const Field& other) { | 64 | Field(Field&&) = default; |
| 64 | type = other.type; | 65 | Field& operator=(Field&& other) = default; |
| 65 | name = other.name; | ||
| 66 | value = other.value; | ||
| 67 | return *this; | ||
| 68 | } | ||
| 69 | |||
| 70 | Field& operator=(Field&& other) { | ||
| 71 | type = other.type; | ||
| 72 | name = std::move(other.name); | ||
| 73 | value = std::move(other.value); | ||
| 74 | return *this; | ||
| 75 | } | ||
| 76 | 66 | ||
| 77 | void Accept(VisitorInterface& visitor) const override; | 67 | void Accept(VisitorInterface& visitor) const override; |
| 78 | 68 | ||