Add hash_table::reserve
This commit is contained in:
parent
7300679f56
commit
7c5062e081
1 changed files with 15 additions and 0 deletions
|
|
@ -269,6 +269,11 @@ namespace psemek::util
|
|||
return storage_.capacity;
|
||||
}
|
||||
|
||||
void reserve(std::size_t capacity)
|
||||
{
|
||||
ensure_capacity_for(capacity);
|
||||
}
|
||||
|
||||
private:
|
||||
hash_table_storage<T> storage_;
|
||||
std::size_t size_ = 0;
|
||||
|
|
@ -516,6 +521,11 @@ namespace psemek::util
|
|||
return impl_.size();
|
||||
}
|
||||
|
||||
void reserve(std::size_t capacity)
|
||||
{
|
||||
impl_.reserve(capacity);
|
||||
}
|
||||
|
||||
private:
|
||||
detail::hash_table_impl<T, Hash, Equal, detail::id_key_projector> impl_;
|
||||
};
|
||||
|
|
@ -691,6 +701,11 @@ namespace psemek::util
|
|||
return impl_.size() == 0;
|
||||
}
|
||||
|
||||
void reserve(std::size_t capacity)
|
||||
{
|
||||
impl_.reserve(capacity);
|
||||
}
|
||||
|
||||
private:
|
||||
detail::hash_table_impl<std::pair<Key const, Value>, KeyHash, KeyEqual, detail::pair_key_projector> impl_;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue