intersectWith

intersectWith
(
C1
C2
)
(
ref C1 x
,
auto ref const(C2) y
)
if (
isInstanceOf!(SSOHashMapOrSet, C1) &&
isInstanceOf!(SSOHashMapOrSet, C2)
)

Return Value

Type: auto

x eagerly intersected with y. TODO move to container_algorithm.d.

Examples

r-value and l-value intersection

alias K = uint;
alias X = SSOHashMapOrSet!(K, void, null, FNV!(64, true));

auto x = X.withElements([12, 13].s);
auto y = X.withElements([10, 12, 13, 15].s);
y.intersectWith(x);
assert(y.length == 2);
assert(y.contains(12));
assert(y.contains(13));

Meta