Function compactValues

Compacts an associative array by its values

auto auto compactValues(alias pred, T, U) (
  T[U] aa
);

Parameters

NameDescription
pred a unary predicate that returns true if value should be compacted
aa compacted associated array

Returns

compacted associtive array

Since

0.0.1

Example

import ddash.utils: isFalsey;
auto aa = ["a": 1, "b": 0, "c": 2];
assert(aa.compactValues!isFalsey == ["a": 1, "c": 2]);