Skip to content

Fix bool mapped values in array_map - #13

Open
fhgffy wants to merge 1 commit into
Tessil:masterfrom
fhgffy:fix-array-map-bool-values
Open

fhgffy wants to merge 1 commit into
Tessil:masterfrom
fhgffy:fix-array-map-bool-values

Conversation

@fhgffy

@fhgffy fhgffy commented Oct 5, 2026

Copy link
Copy Markdown

Fixes #12.

array_map<char, bool> fails to compile because vector<bool> returns proxy references. This uses a small wrapper to provide real bool references and pointers, while keeping storage for other mapped types unchanged.

Tests cover access, insertion, compaction, copy/move and serialization. All 173 tests pass with GCC 14.2 in C++11/17/20, plus Release and ASan/UBSan builds. Clang, MSVC, macOS and LeakSanitizer were not tested.

An existing crash when inserting into a zero-bucket deserialized empty map is outside this fix; it also reproduces on the original code with int values.

This branch has not been deployed

No deployments
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.

array_map<char, bool> compiles error.

1 participant