http://d.puremagic.com/issues/show_bug.cgi?id=6036
--- Comment #11 from bearophile_h...@eml.cc 2012-10-06 11:08:35 PDT --- (In reply to comment #5) > struct Adder { > int v; > auto opCall(int x) { return x + v; } > } > > auto adder(int v) { > return Adder(v); // How do I call the constructor?? > } > > int main() { > auto a = adder(5); > } A little reduced: struct Adder { int v; int opCall(int x) { return x + v; } } void main() { auto a = Adder(5); } It gives: temp.d(6): Error: need 'this' for opCall type int(int x) Is it expected that the instance opCall disables the implicitly created struct ctor? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------