Skip to content

Fix C++20 iterator concepts and std::unordered_map API gaps - #12

Merged
rigtorp merged 1 commit into
masterfrom
fix/api-compatibility
Nov 14, 2026
Merged

rigtorp merged 1 commit into
masterfrom
fix/api-compatibility

Conversation

@rigtorp

@rigtorp rigtorp commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add default constructor, post-increment operator++(int), and constrained converting constructor to hm_iterator so it satisfies std::forward_iterator and std::ranges::forward_range
  • Add pointer and const_pointer member type aliases
  • Use key_equal() instead of != in clear()
  • Add erase(const_iterator) and operator[](key_type &&), and forward rvalue keys in insert(value_type &&) and emplace_impl
  • Add compile-time and runtime tests in src/HashMapTest.cpp

Test plan

  • clang-format --dry-run --Werror include/rigtorp/HashMap.h src/*.cpp
  • cmake --build --preset debug --parallel && ctest --preset debug
  • cmake --build --preset release --parallel && ctest --preset release
  • cmake --build --preset asan --parallel && ctest --preset asan

@rigtorp
rigtorp force-pushed the fix/api-compatibility branch from 52f9ee3 to c65c5ad Compare November 14, 2026 17:50
@rigtorp
rigtorp merged commit b11efea into master Nov 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant