diff --git a/third_party/vaca/include/Vaca/String.h b/third_party/vaca/include/Vaca/String.h index b1433d175..bbe54ae24 100644 --- a/third_party/vaca/include/Vaca/String.h +++ b/third_party/vaca/include/Vaca/String.h @@ -82,7 +82,10 @@ namespace Vaca { return convert_to(from); } - // Convert to String + // Convert to std::string + template<> VACA_DLL std::string convert_to(const int& from); + + // Convert to std::wstring template<> VACA_DLL String convert_to(const std::string& from); template<> VACA_DLL String convert_to(const int& from); template<> VACA_DLL String convert_to(const long& from); diff --git a/third_party/vaca/src/String.cpp b/third_party/vaca/src/String.cpp index 0d496ad70..72b80d2d8 100644 --- a/third_party/vaca/src/String.cpp +++ b/third_party/vaca/src/String.cpp @@ -195,7 +195,12 @@ template<> double Vaca::convert_to(const String& from) return std::wcstod(from.c_str(), NULL); } -template<> String Vaca::convert_to(const int& from) +template<> std::string Vaca::convert_to(const int& from) +{ + return format_string("%d", from); +} + +template<> std::wstring Vaca::convert_to(const int& from) { return format_string(L"%d", from); }