[Issue 16034] New: map should be possible with a reference only

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 17 05:31:17 PDT 2016


          Issue ID: 16034
           Summary: map should be possible with a reference only
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: greensunny12 at gmail.com

the following doesn't work:

void main()
    struct One
        int entry = 1;
        @disable this(this);
    One[] ones = [One(), One()];

    import std.algorithm.iteration: map;
    import std.algorithm.comparison: equal;
    assert(ones.map!`a.entry + 1`.equal([2, 2]));

foo.d(12): Error: template std.algorithm.iteration.map!"a.entry + 1".map cannot
deduce function from argument types !()(One[]), candidates are:
std.algorithm.iteration.map!"a.entry + 1".map(Range)(Range r) if

(It doesn't matter whether string or real lambda are used)


More information about the Digitalmars-d-bugs mailing list