Re: How do you safely deal with range.front?
Tony via Digitalmars-d-learn Sat, 30 Dec 2017 17:06:06 -0800
For me, front() should throw a pre-defined exception when called
on an empty range in order to eliminate undefined behavior. It
does take some time to make a check, but D does array bounds
checking by default. Ideally the front() check could be turned
off somehow ("-boundschecks=off") by the user for those who want
maximum speed, but I guess there is no way to do that when using
pre-compiled functions in a library.
- How do you safely deal with range... aliak via Digitalmars-d-learn
- Re: How do you safely deal w... Seb via Digitalmars-d-learn
- Re: How do you safely de... aliak via Digitalmars-d-learn
- Re: How do you safely deal w... Jonathan M Davis via Digitalmars-d-learn
- Re: How do you safely deal w... Dukc via Digitalmars-d-learn
- Re: How do you safely de... aliak via Digitalmars-d-learn
- Re: How do you safel... Mengu via Digitalmars-d-learn
- Re: How do you safel... Dukc via Digitalmars-d-learn
- Re: How do you s... Tony via Digitalmars-d-learn
- Re: How do ... aliak via Digitalmars-d-learn
- Re: How... Tony via Digitalmars-d-learn
- Re: How... ag0aep6g via Digitalmars-d-learn
- Re: How do ... Jonathan M Davis via Digitalmars-d-learn
- Re: How do ... aliak via Digitalmars-d-learn
- Re: How do you safel... Ali Çehreli via Digitalmars-d-learn
- Re: How do you s... aliak via Digitalmars-d-learn
- Re: How do you safely deal w... aliak via Digitalmars-d-learn
- Re: How do you safely de... Jonathan M Davis via Digitalmars-d-learn