I'm currently using a simple i/o conversion function
template <class T, class U>
inline void ss_convert(const T& t, U& u){
stringstream ss;
ss << t;
ss >> u;
}
I know I'm not checking for any errors, but set that aside for the moment. How can I modify the code to instantiate an object of type U and then return it, without passing a reference? I.e., I'd like to be able to write
T t = T();
U u = ss_convert(t, U)
where the second argument to ss_convert is the class (e.g. int) itself rather than an instance of the class. Is this possible?