Browse Source

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

Michele Caini 1 year ago
parent
commit
b9c50bc731
1 changed files with 4 additions and 4 deletions
  1. 4 4
      test/entt/meta/meta_factory.cpp

+ 4 - 4
test/entt/meta/meta_factory.cpp

@@ -21,7 +21,7 @@ struct clazz: base {
     clazz(int val)
     clazz(int val)
         : value{val} {}
         : value{val} {}
 
 
-    explicit operator int() const noexcept {
+    [[nodiscard]] explicit operator int() const noexcept {
         return get_int();
         return get_int();
     }
     }
 
 
@@ -33,15 +33,15 @@ struct clazz: base {
         value = val.value;
         value = val.value;
     }
     }
 
 
-    int get_int() const noexcept {
+    [[nodiscard]] int get_int() const noexcept {
         return value;
         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());
         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)};
         return clazz{std::stoi(value)};
     }
     }