How to re-initialise an associative array.

Gary Willoughby dev at nomad.so
Wed Nov 6 08:15:34 PST 2013


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.
	}


More information about the Digitalmars-d-learn mailing list