T
thomas
Hi,
In my mind, string and vector<char> are equivalent in some sense.
But I have found that the vector operation "pop_back()" is missing
for "string". I prefer the "string" to "vector<char>" when playing
strings. But I will need the "pop_back()" operation from time to
time.
I know that "resize(str.size()-1)" is a workaround, but I'm not
sure if there is any efficiency loss compared with "pop_back()" etc.
Thanks.
Thomas.
In my mind, string and vector<char> are equivalent in some sense.
But I have found that the vector operation "pop_back()" is missing
for "string". I prefer the "string" to "vector<char>" when playing
strings. But I will need the "pop_back()" operation from time to
time.
I know that "resize(str.size()-1)" is a workaround, but I'm not
sure if there is any efficiency loss compared with "pop_back()" etc.
Thanks.
Thomas.