equivalent of remove_if in D
Asked Answered
R

1

8

Recently I have taken an interest in the D programming language. I just started learning it, and am coming from a C++ background. I am wondering if there is an equivalent of std::remove_if. I only saw remove looking through docs on the dlang site.
If there isn't a direct equivalent, what is the proper or most idiomatic way of achieving the same result in D?
edit: I should add that I am thinking in the context of erase-remove

Rightist answered 2/7, 2013 at 7:54 Comment(0)
B
8

there is std.algortihm.remove(pred,Range)(Range) (look a bit further down the page) which does what you ask

Bedside answered 2/7, 2013 at 10:49 Comment(1)
ah, I should have payed closer attention to the docs. thanks :)Rightist

© 2022 - 2024 — McMap. All rights reserved.