opCall/ctor partially sorted out

Andrej Mitrovic andrej.mitrovich at gmail.com
Sat Oct 6 19:57:18 PDT 2012


On 10/7/12, bearophile <bearophileHUGS at lycos.com> wrote:
> Do you think this has to be correct code?
>
> struct Adder {
>      int v;
>      int opCall(int x) { return x + v; }
> }
> void main() {
>      auto a = Adder(5);
> }

opCall isn't static so there's no ambiguity here imo.


More information about the Digitalmars-d mailing list