|
From: | Júlio Hoffimann |
Subject: | Re: Random questions |
Date: | Wed, 26 Dec 2012 18:20:57 -0300 |
// FIXME -- removing all commas does too much...
- std::string::iterator se = str.end ();
- se = std::remove (str.begin (), se, ',');
- str.erase (se, str.end ());
+ str.erase (std::remove (str.begin (), str.end(), ','), str.end ());
What is the FIXME about in this code hunk? Can the code be fixed and the comment removed?
Also, be careful about the new _expression_. I can't recall any statements about defined order of evaluation for C++ function arguments. If the rightmost str.end() is evaluated before the leftmost str.end(), could it be problematic? Maybe there is something about the recursive level I don't recall, but if there is a reference that ensures order, please indicate.
[Prev in Thread] | Current Thread | [Next in Thread] |