I have the following function
template<class T> T stringTo(const std::string& s)
{
std::istringstream iss(s);
T x;
iss>>x;
return x;
};
and when I apply it as follows:
session ft = stringTo<session>("F");
where session is:
enum session {F, S, T};
I get a Segmentation fault.
can you help me figure out where my error lies...