Mercurial > minori
comparison include/core/ini.h @ 122:bc218c9d2ea6
strings: convert ToInt() to be a template
ini: conform to new strings.cc changes
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 08 Nov 2023 21:36:09 -0500 |
parents | 275da698697d |
children | 7d3ad9529c4c |
comparison
equal
deleted
inserted
replaced
121:a66c47c1ba3c | 122:bc218c9d2ea6 |
---|---|
41 if constexpr (std::is_arithmetic<T>::value) { | 41 if constexpr (std::is_arithmetic<T>::value) { |
42 /* Integer? */ | 42 /* Integer? */ |
43 if constexpr (std::is_same<T, bool>::value) { | 43 if constexpr (std::is_same<T, bool>::value) { |
44 /* Boolean? */ | 44 /* Boolean? */ |
45 return Strings::ToBool(val); | 45 return Strings::ToBool(val); |
46 } else if constexpr (std::is_unsigned<T>::value) { | |
47 /* Unsigned? */ | |
48 return Strings::ToUnsignedInt(val); | |
49 } else { | 46 } else { |
50 /* Always fall back to long long */ | 47 /* Always fall back to long long */ |
51 return Strings::ToInt(val); | 48 return Strings::ToInt<T>(val); |
52 } | 49 } |
53 } else { | 50 } else { |
54 return val; | 51 return val; |
55 } | 52 } |
56 } | 53 } |