I have a template class that needs to parse a string into the user-defined type.
void parse(const std::string& value)
std::stringstream stream_value(value, std::stringstream::in);
stream_value >> data;
This works like a charm for everything except, ironically, strings. Strings end at the first space instead of the end of the passed string.
Obviously I can't use getline since the data may not be a strings (it could be an int, float, or user-defined class) so I either need a way to serialize the whole line for strings or a different general-purpose way to parse the data.