x eagerly intersected with y. TODO move to container_algorithm.d.
r-value and l-value intersection
1 version(showEntries) dbg(); 2 3 import std.typecons : Nullable; 4 import nxt.digestx.fnv : FNV; 5 import nxt.array_help : s; 6 7 alias K = Nullable!(uint, uint.max); 8 alias X = OpenHashSet!(K, FNV!(64, true)); 9 10 auto x = X.withElements([K(12), K(13)].s); 11 auto y = X.withElements([K(10), K(12), K(13), K(15)].s); 12 y.intersectWith(x); 13 assert(y.length == 2); 14 assert(y.contains(K(12))); 15 assert(y.containsUsingLinearSearch(K(12))); 16 assert(y.contains(K(13))); 17 assert(y.containsUsingLinearSearch(K(13)));