The GCC 4.4.7 implementation of std::to_string only has overloads for long long int, long long unsigned int and long double. It's better to use std::stringstream with this version of GCC to avoid having to write custom code.