diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-04-06 15:10:04 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-04-06 15:11:47 +0200 |
| commit | 4d938cd31a35cd4322fe914edd568faa5391c9c2 (patch) | |
| tree | 749af894d900cbb903ba9e51853a42f0c5427594 /libs/kstd | |
| parent | 3dcd14a0570fef3bcc68d7df42fe3ff4cd496f93 (diff) | |
| download | teachos-4d938cd31a35cd4322fe914edd568faa5391c9c2.tar.xz teachos-4d938cd31a35cd4322fe914edd568faa5391c9c2.zip | |
kernel/acpi: implement basic table discovery
Diffstat (limited to 'libs/kstd')
| -rw-r--r-- | libs/kstd/include/kstd/flat_map | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/kstd/include/kstd/flat_map b/libs/kstd/include/kstd/flat_map index 6ffbbcf..3b13754 100644 --- a/libs/kstd/include/kstd/flat_map +++ b/libs/kstd/include/kstd/flat_map @@ -205,6 +205,24 @@ namespace kstd return const_reverse_iterator{cbegin()}; } + //! Check whether this flat map is empty or not + [[nodiscard]] auto empty() const noexcept -> bool + { + return m_containers.keys.empty(); + } + + //! Get the number of elements in this flat map. + [[nodiscard]] auto size() const noexcept -> size_type + { + return m_containers.keys.size(); + } + + //! Get the maximum number of elements possible in this flat map + [[nodiscard]] auto max_size() const noexcept -> size_type + { + return std::min(m_containers.keys.max_size(), m_containers.values.max_size()); + } + //! Try to insert a new key-value pair into the map. //! //! @param args Arguments to use for constructing the key-value pair. |
