Miscellany
public text v1 · immutable#ifndef _H_UTILITY_
#define _H_UTILITY_
#include <sstream>
template <typename T>
T string_cast (const std::string& in) {
T out;
std::istringstream s(in);
s >> out;
return out;
}
template <typename T>
std::string string_cast(const T& in) {
std::ostringstream s;
s << in;
return s.str();
}
#endif