Skip to content

Instantly share code, notes, and snippets.

@tyabu12
Last active April 1, 2018 16:14
Show Gist options
  • Save tyabu12/d6ac1b68d5ad473aaedc to your computer and use it in GitHub Desktop.
Save tyabu12/d6ac1b68d5ad473aaedc to your computer and use it in GitHub Desktop.
#include <sstream>
template<typename T>
inline T from_s(const std::string& s) { T v; std::istringstream i(s); i >> v; return v; }
template<typename T>
inline std::string to_s(const T& x) { std::ostringstream o; o << x; return o.str(); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment