Skip to content

Conversation

sssooonnnggg
Copy link
Contributor

No description provided.

@github-actions github-actions bot added c++ codegen Involving generating code from schema labels May 11, 2023
@sssooonnnggg sssooonnnggg force-pushed the master branch 2 times, most recently from f9c02b9 to 197a4c8 Compare May 11, 2023 11:31
Copy link
Collaborator

@dbaileychess dbaileychess left a comment

Choose a reason for hiding this comment

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

The last thing I think is evolution test. It should be invalid to change the backing type of a union. Can you add this as well?

@sssooonnnggg
Copy link
Contributor Author

sssooonnnggg commented May 15, 2023

@dbaileychess Hi, I've added evolution tests for enum / union underlying type changes

@sssooonnnggg sssooonnnggg requested a review from dbaileychess May 15, 2023 02:42
@dbaileychess dbaileychess merged commit 1d3afb9 into google:master May 15, 2023
@dbaileychess
Copy link
Collaborator

Great! Thanks for the multiple edits.

@jmillan
Copy link
Contributor

jmillan commented Sep 13, 2023

Hi @sssooonnnggg , would you please briefly comment what is this change about? I see no description at all in the PR.

Thanks

@sssooonnnggg
Copy link
Contributor Author

sssooonnnggg commented Sep 13, 2023

Hi @jmillan , the default union implementation use a single byte to store union associative enums, which limits union count must smaller than 256 , this feature allow union to specify an underlying type to store union associative enums with arbitrary integer type.

For example:

union LargeUnion: int { A, B, C, ...}

jochenparm pushed a commit to jochenparm/flatbuffers that referenced this pull request Oct 29, 2024
* feat(C++): support underlying type for union

* chore: add conform checks for underlying type changes
jochenparm pushed a commit to jochenparm/flatbuffers that referenced this pull request Oct 29, 2024
* feat(C++): support underlying type for union

* chore: add conform checks for underlying type changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ codegen Involving generating code from schema lua
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants