A Riddle: what is wrong with this code using std.array.Appender?

Andrea Fontana nospam at example.org
Mon Mar 25 15:44:08 UTC 2019


On Monday, 25 March 2019 at 14:58:08 UTC, FeepingCreature wrote:
> class Class
> {
>     Appender!(int[]) app = null;
> }
>
> This is the most evil bug I've seen this year yet.
>
> Hint: Appender is a struct, not a class. So what does "= null" 
> do, when it appears as a default initializer?

Previously on dlang forum:
https://forum.dlang.org/post/suezctpobjjoanyummjm@forum.dlang.org


More information about the Digitalmars-d mailing list