在D中是否有类似LINQ select的东西?
我想从容器中删除给定数组中的对象成员中包含的所有元素。我认为如果可以的话会很好:
myContainer.remove( myArray.select!( a => a.member ) ) ;
它叫做map
:
import std.algorithm;
myContainer.remove(myArray.map!(a => a.member));
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句