diff options
| author | Maxime Coste <maxime.coste@havok.com> | 2015-01-13 13:47:46 +0000 |
|---|---|---|
| committer | Maxime Coste <maxime.coste@havok.com> | 2015-01-13 13:47:46 +0000 |
| commit | b9c4fc2d8c455991d1ffda250df5acacf5949a82 (patch) | |
| tree | dec84b141a17e81612207e77c05e5edd6fed597a /src/string.hh | |
| parent | 9b4dc8d56be05fa74f53ca327c6c174252dd08ec (diff) | |
Add size_t and float to_string overload, and _sv UDL
Diffstat (limited to 'src/string.hh')
| -rw-r--r-- | src/string.hh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/string.hh b/src/string.hh index 18e9ae4e..54a8b900 100644 --- a/src/string.hh +++ b/src/string.hh @@ -259,6 +259,11 @@ inline String operator"" _str(const char* str, size_t) return String(str); } +inline StringView operator"" _sv(const char* str, size_t len) +{ + return StringView(str, (int)len); +} + inline String codepoint_to_str(Codepoint cp) { StringBase str; @@ -269,6 +274,8 @@ inline String codepoint_to_str(Codepoint cp) int str_to_int(StringView str); String to_string(int val); +String to_string(size_t val); +String to_string(float val); template<typename RealType, typename ValueType> String to_string(const StronglyTypedNumber<RealType, ValueType>& val) |
