Skip to content

Use generics for list types.#229

Merged
lthibault merged 2 commits into
capnproto:mainfrom
zenhack:generic-list
Apr 4, 2022
Merged

Use generics for list types.#229
lthibault merged 2 commits into
capnproto:mainfrom
zenhack:generic-list

Conversation

@zenhack

@zenhack zenhack commented Apr 4, 2022

Copy link
Copy Markdown
Contributor

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.

@lthibault lthibault left a comment

Copy link
Copy Markdown
Collaborator

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