Engine → Core → flat_hash_map.h
flat_hash_set
| Type | Class |
| Namespace | conjure::core |
| Include File Path | engine/include/conjure/core/containers/flat_hash_map.h |
| Source File Path | N/A |
| API ↗ | Containers |
Syntax
template <typename K, typename Hash = std::hash<K>, typename Eq = std::equal_to<K>> class flat_hash_set
Constructors
| Access | Signature | Description |
|---|---|---|
| public | flat_hash_set() = default; | |
| public | explicit flat_hash_set(
usize initialCapacity); | Pre-sizes the table for initialCapacity elements; 0 allocates nothing. |
| public | flat_hash_set(
std::initializer_list<K> values); | |
| public | flat_hash_set(
const flat_hash_set &) = default; | |
| public | flat_hash_set(
flat_hash_set &&) noexcept = default; |
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~flat_hash_set() = default; |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| public | MAX_CAPACITY | static constexpr usize | table_ | |
| public | MAX_ | static constexpr f32 | table_ | |
| private | mTable | table_type | {} |
Functions
Public
begin
begin[[nodiscard]] const_iterator begin() const noexcept;capacity
capacity[[nodiscard]] usize capacity() const noexcept;cbegin
cbegin[[nodiscard]] const_iterator cbegin() const noexcept;cend
cend[[nodiscard]] const_iterator cend() const noexcept;clear
clearvoid clear() noexcept;contains
contains[[nodiscard]] bool contains(
const K &key) const noexcept;count
count[[nodiscard]] usize count(
const K &key) const noexcept;emplace
emplacetemplate <typename... Args> std::pair<const_iterator, bool> emplace(
Args &&...args);empty
empty[[nodiscard]] bool empty() const noexcept;end
end[[nodiscard]] const_iterator end() const noexcept;find
find[[nodiscard]] const_iterator find(
const K &key) const noexcept;insert
insertstd::pair<const_iterator, bool> insert(
const K &value);Inserts when absent. Returns the element and whether it was inserted.
std::pair<const_iterator, bool> insert(
K &&value);template <std::input_iterator Iterator> void insert(
Iterator first,
Iterator last);load_factor
load_factor[[nodiscard]] f32 load_factor() const noexcept;reserve
reservevoid reserve(
usize count);Makes room for count elements without a rehash during the next insertions. reserve(0) does nothing, so an empty set stays unallocated.
size
size[[nodiscard]] usize size() const noexcept;swap
swapvoid swap(
flat_hash_set &other) noexcept;Operator Overloads
Public
operator=
operator=flat_hash_set &operator=(
const flat_hash_set &) = default;flat_hash_set &operator=(
flat_hash_set &&) noexcept = default;operator==
operator==[[nodiscard]] bool operator==(
const flat_hash_set &other) const;Same elements, regardless of slot order.