// converts from type T to string template string toStr(T val) { stringstream ss; ss << val; return ss.str(); }