Problem with C++ ranges also exhibited by D

Atila Neves atila.neves at gmail.com
Wed Apr 17 08:37:56 UTC 2019


On Tuesday, 16 April 2019 at 17:14:17 UTC, Ali Çehreli wrote:
> On 04/16/2019 05:07 AM, Atila Neves wrote:
> > "Is it really necessary
> > to have separate operations for advancing the iterator and
> evaluating
> > its element?".
>
> I've been under the impression that such separation is for 
> strong exception guarantee. We can't popFront (and C++ cannot 
> operator++) before knowing that the copy of the returned value 
> has not thrown an exception.
>
> The article you've linked does not even mention exceptions so 
> perhaps this concern is now historical? Or perhaps there are no 
> types that throw during copy anymore, meaning that they are 
> either trivial bits or reference types?
>
> Ali

That's a good point. I doubt the concern is historical, maybe the 
author just didn't know about it.


More information about the Digitalmars-d mailing list