R
Richard Clay
It seems odd that there is (apparently) no way of telling the istreamfirst space.
What I want to do is this:
string source("7 one two 5 fruit 3 tea 6 banana");
istringstream iss(source);
int strLen;
iss >> strLen; // get length of next string, 7 in first case
iss.force_next_string_read_to_be_this_length(strLen);
string s;
iss >> s; // s = "one two" in first case
Any elegant solutions? Don't think so - iss.width() is all about
maximum lengths, not minimum.
What I want to do is this:
string source("7 one two 5 fruit 3 tea 6 banana");
istringstream iss(source);
int strLen;
iss >> strLen; // get length of next string, 7 in first case
iss.force_next_string_read_to_be_this_length(strLen);
string s;
iss >> s; // s = "one two" in first case
Any elegant solutions? Don't think so - iss.width() is all about
maximum lengths, not minimum.