Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 33,147 of 33,346    |
|    =?ISO-8859-1?Q?Daniel_Kr=FCgler?= to All    |
|    Re: input iterators and post increment    |
|    25 Jul 13 02:57:43    |
      From: daniel.kruegler@googlemail.com              On 2013-07-25 08:50, fmatthew5876 wrote:       > In that case I think my original idea of returning a default       > constructed iterator which will assert when dereferenced is the best       > solution. Crash immediately is the better than random crashes/bugs       > showing up later.              I don't understand what you mean. If your input iterator returns a       proxy result, there is no reason why this could cause the code to be       dangerous that could lead to random crashes. Would you please       elaborate?              > This is a hole in the standard and should be fixed.              I don't understand for the hole here that needs to be fixed.              > Post-increment is a rather silly operation. Its nothing more than       > syntactic sugar and for complicated iterators that do all sorts of       > magic behind the the scenes it has very little value. It seems like       > another classic example of operator overloading abuse.              Maybe, but so is operator-> and the requirements have existed for       decades. Personally I would instead suggest to introduce a new       iterator category set that does better discriminate traversal and       access. When doing so, the requirement for post-fix increment could be       reconsidered or moved to higher-level iterator traversal categories.              > I would propose the following changes:       > Not only is post-increment completely useless and dangerous for       > input/output iterators, its also inefficient for all iterators.              It's inefficient for many non-pointer iterators, but it is not       dangerous. I don't think that an efficiency argument alone could       convince the committee to break code that exists since decades.              HTH & Greetings from Bremen,              - Daniel Krügler                            --        [ See http://www.gotw.ca/resources/clcm.htm for info about ]        [ comp.lang.c++.moderated. First time posters: Do this! ]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca