The example for appender located here, does not compile with GDC.

https://dlang.org/library/std/array/appender.html

void main()
{
    import std.array;
    import std.stdio: write, writeln, writef, writefln;
    auto w = appender!string;
// pre-allocate space for at least 10 elements (this avoids costly reallocations)
    w.reserve(10);
    assert(w.capacity >= 10);

    w.put('a'); // single elements
    w.put("bc"); // multiple elements

    // use the append syntax
    w ~= 'd';
    w ~= "ef";

    writeln(w[]); // "abcdef"


}

For the line "Writeln(w[]);" GDC reports "error: no [] operator overload for type Appender!string".

It works with DMD.

Time to file  a bug report with GCC-GDC?

Reply via email to