| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 116df2a commit 0fbfb28
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -163,22 +163,19 @@ class SnapshotSerializerDeserializer { | |||
| 163 | 163 | V(std::string) | |
| 164 | 164 | ||
| 165 | 165 | #define V(TypeName) \ | |
| 166 | - if (std::is_same_v<T, TypeName>) { \ | ||
| 166 | + if constexpr (std::is_same_v<T, TypeName>) { \ | ||
| 167 | 167 | return #TypeName; \ | |
| 168 | - } | ||
| 168 | + } else // NOLINT(readability/braces) | ||
| 169 | 169 | TYPE_LIST(V) | |
| 170 | 170 | #undef V | |
| 171 | 171 | ||
| 172 | - std::string name; | ||
| 173 | - if (std::is_arithmetic_v<T>) { | ||
| 174 | - if (!std::is_signed_v<T>) { | ||
| 175 | - name += "u"; | ||
| 176 | - } | ||
| 177 | - name += std::is_integral_v<T> ? "int" : "float"; | ||
| 178 | - name += std::to_string(sizeof(T) * 8); | ||
| 179 | - name += "_t"; | ||
| 172 | + if constexpr (std::is_arithmetic_v<T>) { | ||
| 173 | + return (std::is_unsigned_v<T> ? "uint" | ||
| 174 | + : std::is_integral_v<T> ? "int" | ||
| 175 | + : "float") + | ||
| 176 | + std::to_string(sizeof(T) * 8) + "_t"; | ||
| 180 | 177 | } | |
| 181 | - return name; | ||
| 178 | + return ""; | ||
| 182 | 179 | } | |
| 183 | 180 | ||
| 184 | 181 | bool is_debug = false; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments