Hash Tables in D

Jacob Carlborg via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Thu Jan 7 23:39:14 PST 2016


On 2016-01-07 15:11, Steven Schveighoffer wrote:

> With dcollections [1] I had a feature called "purging" where you would
> iterate over a collection like this:
>
> foreach(ref bool removeIt, int val; collection)
> {
>     if(someCondition) removeIt = true;
> }
>
> The entire reason for this is because you can do something similar in
> C++ containers, and I found it absolutely annoying that the existing
> container classes don't allow this. A very frequent use of containers is
> to iterate through picking which ones should be removed (think of a cache)

In Ruby that's called "reject", i.e. the opposite of "filter".

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list