On Wednesday, 6 November 2013 at 16:15:36 UTC, Gary Willoughby wrote:
A simple request but i'm failing hard. How do i re-init an associative array? This is obviously not the way:

        import std.stdio;

        void main(string[] args)
        {
                int[string] x;

                x["hello"] = 1;
                x["world"] = 2;

                writefln("%s", x);

                x = new int[string];

                writefln("%s", x); // Should be empty.
        }

Maybe there's a neater way but x = x.init works.

Reply via email to