test: [[nodiscard]] to make the linter happy

This commit is contained in:
Michele Caini
2024-12-12 09:16:38 +01:00
parent 41c41e9e30
commit b9c50bc731
+4 -4
View File
@@ -21,7 +21,7 @@ struct clazz: base {
clazz(int val)
: value{val} {}
explicit operator int() const noexcept {
[[nodiscard]] explicit operator int() const noexcept {
return get_int();
}
@@ -33,15 +33,15 @@ struct clazz: base {
value = val.value;
}
int get_int() const noexcept {
[[nodiscard]] int get_int() const noexcept {
return value;
}
static std::string to_string(const clazz &instance) {
[[nodiscard]] static std::string to_string(const clazz &instance) {
return std::to_string(instance.get_int());
}
static clazz from_string(const std::string &value) {
[[nodiscard]] static clazz from_string(const std::string &value) {
return clazz{std::stoi(value)};
}