Mercurial > minori
comparison include/core/strings.h @ 348:6b0768158dcd
text: redesign almost every widget
i.e. Paragraph is now a QLabel, etc etc, some things will probably
break, idc
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Tue, 25 Jun 2024 11:19:54 -0400 |
parents | a0aa8c8c4307 |
children |
comparison
equal
deleted
inserted
replaced
347:a0aa8c8c4307 | 348:6b0768158dcd |
---|---|
51 std::istringstream s(str); | 51 std::istringstream s(str); |
52 s >> std::noboolalpha >> def; | 52 s >> std::noboolalpha >> def; |
53 return def; | 53 return def; |
54 } | 54 } |
55 | 55 |
56 template<typename T, std::enable_if_t<std::is_integral<T>::value && !std::is_same<T, bool>::value, bool> = true> | 56 template<typename T, std::enable_if_t<std::is_arithmetic<T>::value && !std::is_same<T, bool>::value, bool> = true> |
57 std::string ToUtf8String(T i) { | 57 std::string ToUtf8String(T i) { |
58 std::ostringstream s; | 58 std::ostringstream s; |
59 s << i; | 59 s << std::noboolalpha << i; |
60 return s.str(); | 60 return s.str(); |
61 } | 61 } |
62 | 62 |
63 bool ToBool(const std::string& s, bool def); | 63 bool ToBool(const std::string& s, bool def); |
64 | 64 |