Skip to content

Add tests for std::[unordered_][multi]map#62

Open
enirolf wants to merge 4 commits intoroot-project:mainfrom
enirolf:types-maps
Open

Add tests for std::[unordered_][multi]map#62
enirolf wants to merge 4 commits intoroot-project:mainfrom
enirolf:types-maps

Conversation

@enirolf
Copy link
Copy Markdown
Contributor

@enirolf enirolf commented Feb 26, 2026

closes #13

Copy link
Copy Markdown
Member

@hahnjo hahnjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good already! One minor question about the documented column types and I think we need to sort the unordered associative containers

- `[Split]Index{32,64}`

with the corresponding column type for the offset column of the collection parent field.
All child fields use the default column types for `std::string` (`SplitIndex64` for the principal column, `Char` for the second column) and `std::int32_t` (`SplitInt32`).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? Since we are writing without compression, the defaults should be Index64 and Int32 I believe

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah you're right, forgot we are not compressing :)

static void PrintNestedUnorderedMapValue(const REntry &entry,
std::string_view name,
std::ostream &os, bool last = false) {
UnorderedMap &item = *entry.GetPtr<UnorderedMap>(name);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as for std::unordered_set, we need to sort the (key, value) pairs by key before printing


static void PrintMultimapValue(const REntry &entry, std::string_view name,
std::ostream &os, bool last = false) {
UnorderedMultimap &item = *entry.GetPtr<UnorderedMultimap>(name);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here for std::unordered_multimap

@hahnjo hahnjo added this to the 1.0 milestone Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test(s) for std::[unordered_][multi]map

2 participants