Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generics for list types. #229

Merged
merged 2 commits into from
Apr 4, 2022
Merged

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Apr 4, 2022

This defines two generic types in the main package, EnumList and StructList, and then makes the generated Foo_List types aliases for one or the other, depending on the representation of the type.

I'd like to add the ability to do NewStructList[Foo](seg, length), but that requires NewStructList to be able to get the correct sizes for the struct Foo; doable, but I'm going to punt to a later patch.

Copy link
Collaborator

@lthibault lthibault left a comment

Choose a reason for hiding this comment

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

LGTM.

@lthibault lthibault merged commit 70a6718 into capnproto:main Apr 4, 2022
@zenhack zenhack deleted the generic-list branch April 4, 2022 19:24
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.

2 participants