There's boost::lexical_cast which allows you to do
Code:
int n = 100;
std::string s = boost::lexical_cast<std::string>(100);
However, conversion to string is simpler than the other way round (less chances of failure), so it wouldn't be hard to implement a to_string function for any type supporting operator<< using only standard libraries:
Code:
#include <sstream>
#include <string>
template <class T>
std::string to_string(const T& value)
{
std::stringstream ss;
ss << value;
return ss.str();
}
int main()
{
int n = 100;
std::string s = to_string(n);
}