import std.stdio; import std.algorithm; void main() { auto arr = [ 1, 2, 3, 4, 5, 6, 7 ]; // The default strategy is SwapStrategy.stable arr = arr.remove!(a => a % 2, SwapStrategy.unstable); writeln(arr); }
原文