-1
我在cygwin上,所以我不能使用std::to_string
,這是一個着名的bug。我試過這個:如何寫入to_string函數?
#include <string>
template<typename T>
std::string to_string(const T& val)
{
std::ostringstream stream;
stream << val;
return stream.str(); //invalid use of incomplete type
}
int main(){ }
但編譯器給了我一個錯誤。我該如何解決這個問題?
你應該包括 –
sajas
2015-03-25 06:04:38
什麼樣的錯誤,在問題中添加它。 – 2015-03-25 06:58:34