On Friday, October 18, 2013 09:02:49 simendsjo wrote:
> On Friday, 18 October 2013 at 06:56:49 UTC, monarch_dodra wrote:
> (...)
>
> > struct S
> > {
> >
> > this(int i = 5)
> > {}
> >
> > }
> > S s = S(); //Does *not* call the constructor with the value 5.
>
> I didn't know that. In that case, I think struct ctors with only
> optional parameters should be illegal - how is it possible to
> call it?
> Struct ctors without parameters is already illegal due to .init.
I think that there's a bug report on that somewhere, but I'd have to go
digging for it.
The only way that S() is anything other than S.init is if you overloaded
opCall and made it static, in which case, S() becomes a call to that.
- Jonathan M Davis