Built-in types or Plain Old Datas like ints do not have methods. The idea of streams is that you can convert anything from anything, not only PODs.
What you are looking for, is a boost::lexical_cast<>, which can work like this:
int i = 12;
std::string s = boost::lexical_cast< std::string >( i );
It can be found in the boost library.
You can do your basic version of this method yourself based on your IntToString method, but templated to work with any types.
template<typename To, typename From >
To my_own_cast(const From & f)
{
std::stringstream stream;
stream << f;
To t;
stream >> t;
return t;
}
used like this:
std::string s;
s = my_own_cast< std::string >( 12 );
int i= my_own_cast< int >( s );
Normally, as far as I know, lexical_cast could be a bit more complex in the last version than just using a stream, and try to be more effecient when it can. It was discussed, I'm not sure it's implemented.