I am using the above code inside a template to convert basically any basic type to a string. More to the point float, double and int are being converted to strings
template<class num>
string intToStrig( num )
{
ostringstream stream;
stream<< num << flush;
string str(stream.str());
return str;
}
I am wondering if this is efficient and fast. Is there a better way to do the conversion? This conversion is done constantly and I need it to be a high speed low overhead conversion.
Thanks for your comments
haunter@battlestrata.com
template<class num>
string intToStrig( num )
{
ostringstream stream;
stream<< num << flush;
string str(stream.str());
return str;
}
I am wondering if this is efficient and fast. Is there a better way to do the conversion? This conversion is done constantly and I need it to be a high speed low overhead conversion.
Thanks for your comments
haunter@battlestrata.com