Algorithm remove Tid

monarch_dodra monarchdodra at gmail.com
Wed Jan 22 05:16:17 PST 2014


On Wednesday, 22 January 2014 at 12:11:22 UTC, Casper Færgemand 
wrote:
> import std.algorithm;
> import std.concurrency;
>
> void main() {
> 	Tid[] tids = [];
> 	Tid tid = thisTid;
> 	tids ~= tid;
> 	tids.remove(tid);
> }
>
> Why does this not compile?

Because "remove" takes an "offset" as an argument, not an element.

To remove an element, I *think* you do it this way:

tids = tids.remove!(a=>a == tid)();


More information about the Digitalmars-d-learn mailing list