Multidimension AA's and remove

NX via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 11 23:12:43 PDT 2015


On Saturday, 12 September 2015 at 05:54:13 UTC, NX wrote:
> import std.stdio : writeln, std.algorithm.mutation : remove;

Ooops, this is so wrong! Corrected version:

void main()
{
	import std.stdio : writeln;
	import std.algorithm.mutation : remove;
	
	int[][string] heh = [ "heh":[ 0, 10, 15, 20 ] ];
	heh["heh"][0] = 5;
	writeln(heh); // ["heh":[5, 10, 15, 20]]
	heh["heh"] = remove!(c => (c == 15))(heh["heh"]);
	writeln(heh); // ["heh":[5, 10, 20]]
}


More information about the Digitalmars-d-learn mailing list