Any basic type ToString
10
Transform any basic type to string. Very handy for log messages
Usage:
int i(12);
float j(3.14);
cout
Usage:
int i(12);
float j(3.14);
cout
#include <sstream>
#include <string>
template <class T>
std::string ToString (const T& val)
{
std::stringstream strm;
strm << val;
return strm.str ();
}
#include <string>
template <class T>
std::string ToString (const T& val)
{
std::stringstream strm;
strm << val;
return strm.str ();
}
Comments
Mon. Oct. 9th, 2006 6:20 AM
shell
shell





