Summary: regex(replace with delegate) sample doesn't work
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        Depends on: 1904

--- Comment #0 from SHOO <> 2010-10-06 10:54:09 PDT ---
This code doesn't work!

import std.regex, std.string;

void main()
    string baz(RegexMatch!(string) m)
        return std.string.toupper(m.hit);
    auto s = replace!(baz)("Strap a rocket engine on a chicken.",
        regex("[ar]", "g"));

    std/regex.d(2840): Error: struct std.regex.RegexMatch!(string).RegexMatch
member test is not accessible

See also:

Define the dummy free function for RegexMatch!(string).test.

private bool _dummyTest(Engine)(Engine r, size_t idx)
    return r.test(idx);

This issue is maybe related with bug 1904.
- Template function's alias parameter takes delegate.
- Template function uses same module's structs or classes and calls their
private function.

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

Reply via email to