I have the following code:
template <class T>
static std::string ToString(const T& t)
{
stringstream temp;
temp << t;
return temp.str();
}
It compiles with no problems with Visual C++ on Windows, but when trying to compile it with GCC on Linux I get the following error:
no match for 'operator<<' in 'temp << t'
What could be the reason for that?
Thank you in advance.
That depends on the type T as Space_C0wb0y said.
Check out the following code
A call to
ToString(empty());gives the same error that you have got butToString(non_empty("123"));is fine. What does that imply?