[Issue 18071] [REG2.078] byKey, byValue and byKeyValue are now a hole for unsafe code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 13 16:04:58 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=18071

--- Comment #3 from Jack Stouffer <jack at jackstouffer.com> ---
(In reply to Steven Schveighoffer from comment #2)
> (In reply to Jack Stouffer from comment #1)
> > The first example can be fixed by having `byValue.front` and
> > `byValue.popFront` do this at the beginning of the function:
> > 
> >     if (this.empty)
> >         assert(0, "accessing front on an empty byValue");
> 
> This will have the same effect, as druntime is compiled in release mode.

assert(0) isn't removed in release mode

--


More information about the Digitalmars-d-bugs mailing list