On Tue, 26 Apr 2011 07:24:28 -0400, bearophile <bearophileh...@lycos.com> wrote:

Andrej Mitrovic:

import std.algorithm;

struct Foo
{
    int bar(string) { return 1; }

    void run()
    {
        auto result = map!(bar)(["test"]);
    }
}

void main()
{
}

D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(128): Error: this for bar needs to be type Foo not type Map!(bar,string[])

I can't use a virtual function as an alias parameter to a template, it either has to be a free function or a static function.

Where's the virtual function?

I think he means member function.  Clearly the function is not virtual.

-Steve

Reply via email to