Summary: std.regex: Captures is not a random access range
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Graham Fawcett <> 2010-06-22 
06:12:47 PDT ---
>From the std.regex documentation:

"Captures captures(). Retrieve the captured parenthesized matches, 
in the form of a random-access range."

The Captures struct is not a random access range, because it is not a
forward range. The following test program fails to compile:

import std.regex;
import std.range;

void main() {
  auto c = match("hello", "[aeiou]").captures;
  alias typeof(c) C;
  static assert (isInputRange!C);   // pass
  static assert (isForwardRange!C); // failure
  static assert (isBidirectionalRange!C);
  static assert (isRandomAccessRange!C);

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to