Mercurial > minori
comparison include/core/ini.h @ 136:7d3ad9529c4c
ini: fix bool getters to provide default vals for bools and ints
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Fri, 10 Nov 2023 10:07:01 -0500 |
| parents | bc218c9d2ea6 |
| children | 53211cb1e7f5 |
comparison
equal
deleted
inserted
replaced
| 135:0a458cb26ff4 | 136:7d3ad9529c4c |
|---|---|
| 40 | 40 |
| 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, def); |
| 46 } else { | 46 } else { |
| 47 /* Always fall back to long long */ | 47 /* Always fall back to long long */ |
| 48 return Strings::ToInt<T>(val); | 48 return Strings::ToInt<T>(val, def); |
| 49 } | 49 } |
| 50 } else { | 50 } else { |
| 51 return val; | 51 return val; |
| 52 } | 52 } |
| 53 } | 53 } |
