Add some support for using a map like a set.
This commit is contained in:
parent
cb02425376
commit
4b59ae0aa9
2 changed files with 20 additions and 2 deletions
|
|
@ -105,6 +105,11 @@ fn new_smallintmap_adapter[K, V](fn(&K) -> uint key_idx,
|
|||
idx += 1u;
|
||||
}
|
||||
}
|
||||
iter keys() -> K {
|
||||
for each (@tup(K, V) p in self.items()) {
|
||||
put p._0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto map = smallintmap::mk[V]();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue