[Issue 15202] filter and randomCover do not work together
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Thu Oct 15 00:13:01 PDT 2015
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15202
Jonathan M Davis <issues.dlang at jmdavisProg.com> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dlang at jmdavisProg.co
                   |                            |m
--- Comment #2 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
In the majority of cases, ranges either assert that the range is not empty when
front is called, or they don't check at all, and I wouldn't expect that to
change - not only because of efficiency concerns, but also because of @nogc
(and exceptions currently require the GC). It's simply considered a logic error
to call front or popFront on an empty range. So, if there's any chance that a
range is going to be empty when you're looking to call front or popFront, then
you need to check empty first.
--
    
    
More information about the Digitalmars-d-bugs
mailing list