Hi all,
I'm having problems with the following code:
Code:
std::string somestring;
std::string::size_type st;
st++ = somestring.rfind(' ');
I'm using g++ 4.0.3 and it gives me an error about, "invalid lvalue in assignment."
Obviously, I could modify the last line like this and just get along with it.
Code:
st = somestring.rfind(' ') + 1;
So I've learned for the first time that you cannot increment lvalues (if that's what's causing the problem).
So could somebody tell me why this restriction exists? Or at least throw me a link? Hopefully something more detailed than, "the standard says so."
At the moment, I really can't imagine of what use such a restriction might be.