D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2897 - RandomCover docs wrong: RandomCover needs a random access range.
Summary: RandomCover docs wrong: RandomCover needs a random access range.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 trivial
Assignee: Andrei Alexandrescu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-25 08:44 UTC by David Simcha
Modified: 2015-06-09 01:26 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description David Simcha 2009-04-25 08:44:55 UTC
From RandomCover docs:

"Covers a given range r in a random manner, i.e. goes through each
element of r once and only once, just in a random order. r
must be a forward access range with length."

Reading the source code, it's clear that RandomCover really needs random access:

    ref ElementType!(Range) front()
    {
        return _input[_current];
    }