Does D have too many features?

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Apr 29 13:52:16 PDT 2012


On 4/29/12, Andrej Mitrovic <andrej.mitrovich at gmail.com> wrote:
> struct Foo {
>     auto opIn_r(string op)(int i) { return 1; }
> }

Sorry that's wrong, should be:
struct Foo {
    auto opIn_r(int i) { return 1; }
}

And then you get:
test.d(25): Error: function test.Foo.opIn_r (int i) is not callable
using argument types (string)
test.d(25): Error: cannot implicitly convert expression ("") of type
string to int

which much better than Bar's error message.


More information about the Digitalmars-d mailing list