Give clearer names to template parameters

This commit is contained in:
Rangi
2025-10-08 14:52:34 -04:00
parent 711fba5e35
commit 23b9039716
13 changed files with 118 additions and 102 deletions

View File

@@ -210,15 +210,15 @@ static void warnExtraColors(
}
// Parses the initial part of a string_view, advancing the "read index" as it does
template<typename U> // Should be uint*_t
static std::optional<U> parseDec(std::string const &str, size_t &n) {
template<typename UintT> // Should be uint*_t
static std::optional<UintT> parseDec(std::string const &str, size_t &n) {
uintmax_t value = 0;
auto result = std::from_chars(str.data() + n, str.data() + str.length(), value);
if (static_cast<bool>(result.ec)) {
return std::nullopt;
}
n = result.ptr - str.data();
return std::optional<U>{value};
return std::optional<UintT>{value};
}
static std::optional<Rgba> parseColor(std::string const &str, size_t &n, uint16_t i) {