https://d.puremagic.com/issues/show_bug.cgi?id=12120
Vladimir Panteleev <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #4 from Vladimir Panteleev <[email protected]> 2014-02-10 04:12:04 EET --- (In reply to comment #2) > If you define constructors in a struct, the syntax `Type()` should be reserved > for default construction. > > If you want to support both Foo() and Foo(1), you should change the > constructor > to static Foo opCall(int). If I understood this change correctly, I don't think it is a good change, as I mentioned in the pull request: https://github.com/D-Programming-Language/dmd/pull/3221 This issue only serves as further evidence towards that. (In reply to comment #3) > I am sorry if I missed something, but how do I initialize a struct object > element from a call to Foo()? I believe default constructors are not allowed > for structs. static Foo opCall() { Foo foo; foo.bar = ...; return foo; } -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
