Skip to content

Instantly share code, notes, and snippets.

@eiennohito
Created October 17, 2014 10:09
Show Gist options
  • Save eiennohito/7d0c91381a402872408a to your computer and use it in GitHub Desktop.
Save eiennohito/7d0c91381a402872408a to your computer and use it in GitHub Desktop.
#include <sstream>
#include <iostream>
#include <string>
template<typename T>
std::string to_string(const T& x) {
std::stringstream i;
i << x;
return i.str();
}
int main(int argc, char const *argv[])
{
std::cout << to_string(5) << "\n";
/* code */
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment