diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-05-13 14:23:07 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-05-13 18:43:38 +0200 |
| commit | 26f0fd4cc6577e52b08604d32469b221242bfb9c (patch) | |
| tree | b63d2936ac57352a0cb3a4a863cc735dacedaf1c /src/string.hh | |
| parent | 56ab33c9d6dc0255bf15ebd1fbc216766ffb247c (diff) | |
Use more std::* for string handling
Diffstat (limited to 'src/string.hh')
| -rw-r--r-- | src/string.hh | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/string.hh b/src/string.hh index edfafd02..e579b741 100644 --- a/src/string.hh +++ b/src/string.hh @@ -64,6 +64,16 @@ inline String operator+(const char* lhs, const String& rhs) return String(lhs) + rhs; } +inline String operator+(const std::string& lhs, const String& rhs) +{ + return String(lhs) + rhs; +} + +inline String operator+(const String& lhs, const std::string& rhs) +{ + return lhs + String(rhs); +} + inline String operator+(char lhs, const String& rhs) { return String(lhs) + rhs; @@ -74,9 +84,6 @@ inline String operator+(Codepoint lhs, const String& rhs) return String(lhs) + rhs; } - -String int_to_str(int value); -int str_to_int(const String& str); std::vector<String> split(const String& str, char separator); inline String operator"" _str(const char* str, size_t) @@ -94,6 +101,15 @@ inline String codepoint_to_str(Codepoint cp) String option_to_string(const Regex& re); void option_from_string(const String& str, Regex& re); + +using std::to_string; + +template<typename RealType, typename ValueType> +std::string to_string(const StronglyTypedNumber<RealType, ValueType>& val) +{ + return to_string((ValueType)val); +} + } namespace std |
