diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2025-04-03 06:07:34 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2025-04-03 06:07:34 -0500 |
commit | 090af1b8097fecf6b09f3048811a44e11ece3242 (patch) | |
tree | 9995adaa16751562d72173b8510b6336aa2d5be3 /include/fud_hash_map_impl.hpp | |
parent | e6d9330a978373ffc24209b5edf03eda6491f818 (diff) |
Test hash map extract pair, fix bugs.
Diffstat (limited to 'include/fud_hash_map_impl.hpp')
-rw-r--r-- | include/fud_hash_map_impl.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/fud_hash_map_impl.hpp b/include/fud_hash_map_impl.hpp index 6e224f9..23f5653 100644 --- a/include/fud_hash_map_impl.hpp +++ b/include/fud_hash_map_impl.hpp @@ -151,7 +151,13 @@ struct MapEntry { return *std::bit_cast<Value*>(m_valueData.data()); } - [[nodiscard]] Value&& takeValue() & + [[nodiscard]] constexpr Key&& takeKey() & + { + fudAssert(hasValue()); + return std::move(*std::bit_cast<Key*>(m_keyData.data())); + } + + [[nodiscard]] constexpr Value&& takeValue() & { fudAssert(hasValue()); return std::move(*std::bit_cast<Value*>(m_valueData.data())); |