Timeline for infix_iterator code
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| S Mar 9, 2017 at 9:46 | history | suggested | Toby Speight | CC BY-SA 3.0 | I assume "actionDelimter" was a typo |
| Mar 9, 2017 at 9:08 | review | Suggested edits | |||
| S Mar 9, 2017 at 9:46 | |||||
| Jan 22, 2014 at 7:30 | comment | added | dalle | I would leave delimiter and real_delim as charT const *, but in the constructor do as follows: infix_ostream_iterator(ostream_type &s, charT const *d = 0) : os(&s), delimiter(""), real_delimiter(d ? d : "") {}. That way there even less cost for copying. | |
| Jul 3, 2012 at 15:26 | comment | added | Loki Astari | @Dave. It is not cheaper it is more expensive. But you do not expect to see much copying (as I was trying to say). So I see the extra cost as insignificant, compared to the extra safety we achieve by doing it this way. | |
| Jul 3, 2012 at 13:03 | comment | added | David | Is it really a reasonable assumption to say the copy is cheaper than the condition he previously had? Is there some way to quantify that? | |
| Jul 1, 2012 at 23:13 | vote | accept | Jerry Coffin | ||
| Jul 1, 2012 at 22:21 | comment | added | Loki Astari | @JerryCoffin: I see no down side to that. The overhead is during construction that happens once. Even if it is copied around a lot the extra cost of the copy is not that significant. And all this is totally outweighed by the usage of operator<< | |
| Jul 1, 2012 at 22:20 | history | edited | Loki Astari | CC BY-SA 3.0 | added 397 characters in body |
| Jul 1, 2012 at 14:15 | comment | added | Jerry Coffin | I've been thinking about this a bit. Instead of storing the user's pointer directly, and initializing delimiter to point to an empty string, do you see a problem that I don't with using std::basic_string<charT> for both delimiter and real_delim? Pros: no init to empty string needed, remain valid even if the user's pointer doesn't. Cons: Possibly increased overhead? | |
| Jun 29, 2012 at 23:41 | history | answered | Loki Astari | CC BY-SA 3.0 |