Port yuzu-emu/yuzu#4528: "common: Make use of [[nodiscard]] where applicable" (#5535)

Co-authored-by: LC <712067+lioncash@users.noreply.github.com>
This commit is contained in:
Tobias 2020-08-31 21:06:16 +02:00 committed by GitHub
parent e48110bdf4
commit f6b543886c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 284 additions and 265 deletions

View file

@ -63,30 +63,30 @@ public:
void Accept(VisitorInterface& visitor) const override;
const std::string& GetName() const override {
[[nodiscard]] const std::string& GetName() const override {
return name;
}
/**
* Returns the type of the field.
*/
FieldType GetType() const {
[[nodiscard]] FieldType GetType() const {
return type;
}
/**
* Returns the value of the field.
*/
const T& GetValue() const {
[[nodiscard]] const T& GetValue() const {
return value;
}
bool operator==(const Field& other) const {
[[nodiscard]] bool operator==(const Field& other) const {
return (type == other.type) && (name == other.name) && (value == other.value);
}
bool operator!=(const Field& other) const {
return !(*this == other);
[[nodiscard]] bool operator!=(const Field& other) const {
return !operator==(other);
}
private: