Re: Cannot use std.array.Appender in recursive types

2017-08-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/9/17 6:24 PM, Nordlöw wrote: On Wednesday, 9 August 2017 at 19:00:54 UTC, Steven Schveighoffer wrote: If I change the definition of ElementType to use R.init.front instead of R.init.front.init, it compiles. But I'm pretty sure this will break other ranges. If Phobos compiles with the

Re: Cannot use std.array.Appender in recursive types

2017-08-09 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 9 August 2017 at 19:00:54 UTC, Steven Schveighoffer wrote: If I change the definition of ElementType to use R.init.front instead of R.init.front.init, it compiles. But I'm pretty sure this will break other ranges. If Phobos compiles with the change would that change deserve a

Re: Cannot use std.array.Appender in recursive types

2017-08-09 Thread Timon Gehr via Digitalmars-d-learn
On 09.08.2017 21:00, Steven Schveighoffer wrote: On 8/9/17 2:25 PM, Nordlöw wrote: Why doesn't appending to `subs` work with std.array.Appender in struct T { string src; import std.array : Appender; Appender!(T[]) subs; } T t; t.subs ~=

Re: Cannot use std.array.Appender in recursive types

2017-08-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/9/17 2:25 PM, Nordlöw wrote: Why doesn't appending to `subs` work with std.array.Appender in struct T { string src; import std.array : Appender; Appender!(T[]) subs; } T t; t.subs ~= T.init; // ERRORS t.subs.put(T.init); // ERRORS

Cannot use std.array.Appender in recursive types

2017-08-09 Thread Nordlöw via Digitalmars-d-learn
Why doesn't appending to `subs` work with std.array.Appender in struct T { string src; import std.array : Appender; Appender!(T[]) subs; } T t; t.subs ~= T.init; // ERRORS t.subs.put(T.init); // ERRORS when it works with builtin arrays as in