summaryrefslogtreecommitdiff
path: root/src/common/telemetry.h
diff options
context:
space:
mode:
authorGravatar Lioncash2020-08-14 09:38:45 -0400
committerGravatar Lioncash2020-08-15 17:17:52 -0400
commitdf7248039553b3ebd338380c3ef0428b0e046e79 (patch)
treeeca7153300e311ac7954f5c085fdada0c7295699 /src/common/telemetry.h
parentMerge pull request #4526 from lioncash/core-semi (diff)
downloadyuzu-df7248039553b3ebd338380c3ef0428b0e046e79.tar.gz
yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.tar.xz
yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.zip
common: Make use of [[nodiscard]] where applicable
Now that clang-format makes [[nodiscard]] attributes format sensibly, we can apply them to several functions within the common library to allow the compiler to complain about any misuses of the functions.
Diffstat (limited to 'src/common/telemetry.h')
-rw-r--r--src/common/telemetry.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/telemetry.h b/src/common/telemetry.h
index 854a73fae..4aa299f9a 100644
--- a/src/common/telemetry.h
+++ b/src/common/telemetry.h
@@ -63,30 +63,30 @@ public:
63 63
64 void Accept(VisitorInterface& visitor) const override; 64 void Accept(VisitorInterface& visitor) const override;
65 65
66 const std::string& GetName() const override { 66 [[nodiscard]] const std::string& GetName() const override {
67 return name; 67 return name;
68 } 68 }
69 69
70 /** 70 /**
71 * Returns the type of the field. 71 * Returns the type of the field.
72 */ 72 */
73 FieldType GetType() const { 73 [[nodiscard]] FieldType GetType() const {
74 return type; 74 return type;
75 } 75 }
76 76
77 /** 77 /**
78 * Returns the value of the field. 78 * Returns the value of the field.
79 */ 79 */
80 const T& GetValue() const { 80 [[nodiscard]] const T& GetValue() const {
81 return value; 81 return value;
82 } 82 }
83 83
84 bool operator==(const Field& other) const { 84 [[nodiscard]] bool operator==(const Field& other) const {
85 return (type == other.type) && (name == other.name) && (value == other.value); 85 return (type == other.type) && (name == other.name) && (value == other.value);
86 } 86 }
87 87
88 bool operator!=(const Field& other) const { 88 [[nodiscard]] bool operator!=(const Field& other) const {
89 return !(*this == other); 89 return !operator==(other);
90 } 90 }
91 91
92private: 92private: