Support returning additional data from `CHashMap::alter`
Something like:
pub fn alter_and_return<F, R>(&self, key: K, f: F) -> R
where F: FnOnce(Option<V>) -> (Option<V>, R);
This allows the caller to make use of the fact that the passed function will be called precisely once. The workaround right now is to capture an Option<R>
by mutable reference and then populate the option from within the closure, but it means that the caller must unwrap the option later on and handle the None
case which is not actually possible.