Skip to content

Instantly share code, notes, and snippets.

@maidis
Created February 28, 2011 16:47
Show Gist options
  • Save maidis/847596 to your computer and use it in GitHub Desktop.
Save maidis/847596 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <sstream>
template <class T> inline std::string to_string (const T& t)
{
std::stringstream ss;
ss << t;
return ss.str();
}
int main()
{
int i = 5;
std::cout << i + i << std::endl;
std::cout << to_string(i) + to_string(i) << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment