Re: Private struct constructor

2018-10-04 Thread Ritchie via Digitalmars-d-learn
On Thursday, 4 October 2018 at 09:21:39 UTC, Simen Kjærås wrote: This is apparently a known issue: https://issues.dlang.org/show_bug.cgi?id=18979 which is basically just a special case of this issue: https://issues.dlang.org/show_bug.cgi?id=2775 -- Simen I see. Looks like the chances of i

Re: Private struct constructor

2018-10-04 Thread Simen Kjærås via Digitalmars-d-learn
On Thursday, 4 October 2018 at 08:52:50 UTC, Ritchie wrote: I apologize for not making it clear. I was talking about the private constructor only. The @disable this() is there to prevent struct literal syntax and the other disables really have no reason to be there for the purpose of this quest

Re: Private struct constructor

2018-10-04 Thread Ritchie via Digitalmars-d-learn
On Thursday, 4 October 2018 at 08:14:44 UTC, Simen Kjærås wrote: On Thursday, 4 October 2018 at 07:31:21 UTC, Ritchie wrote: Any reason why this works? https://run.dlang.io/is/TALlyw Yup. Alright, so there's a few features in use here - which one are you asking about? 1. Private construc

Re: Private struct constructor

2018-10-04 Thread Simen Kjærås via Digitalmars-d-learn
On Thursday, 4 October 2018 at 07:31:21 UTC, Ritchie wrote: Any reason why this works? https://run.dlang.io/is/TALlyw Yup. Alright, so there's a few features in use here - which one are you asking about? 1. Private constructor. You can call the private constructor because the unit of enc

Re: Private struct constructor

2018-10-04 Thread Ritchie via Digitalmars-d-learn
On Thursday, 4 October 2018 at 07:55:48 UTC, Andrea Fontana wrote: On Thursday, 4 October 2018 at 07:31:21 UTC, Ritchie wrote: Any reason why this works? https://run.dlang.io/is/TALlyw Why not? The constructor is private.

Re: Private struct constructor

2018-10-04 Thread John Chapman via Digitalmars-d-learn
On Thursday, 4 October 2018 at 07:31:21 UTC, Ritchie wrote: Any reason why this works? https://run.dlang.io/is/TALlyw "private" applies to the module, not the type. https://dlang.org/spec/attribute.html#visibility_attributes

Re: Private struct constructor

2018-10-04 Thread Andrea Fontana via Digitalmars-d-learn
On Thursday, 4 October 2018 at 07:31:21 UTC, Ritchie wrote: Any reason why this works? https://run.dlang.io/is/TALlyw Why not?

Private struct constructor

2018-10-04 Thread Ritchie via Digitalmars-d-learn
Any reason why this works? https://run.dlang.io/is/TALlyw