Like parseInt, but with a generic Character type.
pub fn parseIntWithGenericCharacter(
comptime Result: type,
comptime Character: type,
buf: []const Character,
base: u8,
) ParseIntError!Result
pub fn parseIntWithGenericCharacter(
comptime Result: type,
comptime Character: type,
buf: []const Character,
base: u8,
) ParseIntError!Result {
if (buf.len == 0) return error.InvalidCharacter;
if (buf[0] == '+') return parseIntWithSign(Result, Character, buf[1..], base, .pos);
if (buf[0] == '-') return parseIntWithSign(Result, Character, buf[1..], base, .neg);
return parseIntWithSign(Result, Character, buf, base, .pos);
}