parse: add specialisation for int

This commit is contained in:
Danny Robson 2017-12-19 18:12:35 +11:00
parent bfcd63ec65
commit 36902f1476

View File

@ -84,3 +84,12 @@ C_PARSE(unsigned long long, i)
C_PARSE(float, f)
C_PARSE(double, f)
C_PARSE(long double, f)
template <>
int
util::parse<int> (util::view<const char*> str)
{
auto intermediate = util::parse<long> (str);
return trunc_cast<int> (intermediate);
}