1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-27 01:57:52 +00:00

Instantiate tr_parseNum() template using basic types (#3404)

There're places where e.g. `size_t` is used which may or may not match one of
`(u)intXX_t` types.

Authored-by: Mike Gelfand <mikedld@mikedld.com>
This commit is contained in:
Charles Kerr 2022-07-03 23:28:41 -05:00 committed by GitHub
parent 36b70ed137
commit d62a0bd81e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1415,13 +1415,15 @@ template<typename T, std::enable_if_t<std::is_integral<T>::value, bool>>
#endif // #if defined(__GNUC__) && !__has_include(<charconv>) #endif // #if defined(__GNUC__) && !__has_include(<charconv>)
template std::optional<int64_t> tr_parseNum(std::string_view& sv, int base); template std::optional<long long> tr_parseNum(std::string_view& sv, int base);
template std::optional<int32_t> tr_parseNum(std::string_view& sv, int base); template std::optional<long> tr_parseNum(std::string_view& sv, int base);
template std::optional<int8_t> tr_parseNum(std::string_view& sv, int base); template std::optional<int> tr_parseNum(std::string_view& sv, int base);
template std::optional<char> tr_parseNum(std::string_view& sv, int base);
template std::optional<uint64_t> tr_parseNum(std::string_view& sv, int base); template std::optional<unsigned long long> tr_parseNum(std::string_view& sv, int base);
template std::optional<uint32_t> tr_parseNum(std::string_view& sv, int base); template std::optional<unsigned long> tr_parseNum(std::string_view& sv, int base);
template std::optional<uint8_t> tr_parseNum(std::string_view& sv, int base); template std::optional<unsigned int> tr_parseNum(std::string_view& sv, int base);
template std::optional<unsigned char> tr_parseNum(std::string_view& sv, int base);
template<typename T, std::enable_if_t<std::is_floating_point<T>::value, bool>> template<typename T, std::enable_if_t<std::is_floating_point<T>::value, bool>>
[[nodiscard]] std::optional<T> tr_parseNum(std::string_view& sv) [[nodiscard]] std::optional<T> tr_parseNum(std::string_view& sv)