C++ convert simple values to string
问题 Right now I use the following piece of code to dummily convert basic types ( int , long , char[] , this kind of stuff) to std::string for further processing: template<class T> constexpr std::string stringify(const T& t) { std::stringstream ss; ss << t; return ss.str(); } however I don't like the fact that it depends on std::stringstream . I tried using std::to_string (from C++11's repertoire) however it chokes on char[] variables. Is there a simple way offering an elegant solution for this