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

#272: Add unit test to cover empty base optimization when using tuple #343

Merged
merged 4 commits into from
Jun 18, 2024

Conversation

thearusable
Copy link
Contributor

Closes #272

@thearusable thearusable self-assigned this May 28, 2024
Copy link
Contributor

@nmm0 nmm0 left a comment

Choose a reason for hiding this comment

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

Thanks for doing this. Any chance you could add a test with Base?

The reason I'm asking as that at least in gcc, tuple uses inheritance and therefore EBO:

https://godbolt.org/z/G1qjsEGcx

i.e. sizeof(std::tuple<empty, int>) == 4 but sizeof(empty)+sizeof(int) == 5. So the serialized size might not be the size of the tuple

@thearusable
Copy link
Contributor Author

Thanks for doing this. Any chance you could add a test with Base?

The reason I'm asking as that at least in gcc, tuple uses inheritance and therefore EBO:

https://godbolt.org/z/G1qjsEGcx

i.e. sizeof(std::tuple<empty, int>) == 4 but sizeof(empty)+sizeof(int) == 5. So the serialized size might not be the size of the tuple

@nmm0 Sure I'll add this

@thearusable thearusable force-pushed the 272-add-tuple-tests branch from 213c04b to ff209f0 Compare May 31, 2024 13:54
Copy link
Contributor

@nmm0 nmm0 left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for doing this

@thearusable thearusable force-pushed the 272-add-tuple-tests branch 2 times, most recently from fb25e54 to fd8449e Compare June 10, 2024 09:31
@thearusable thearusable force-pushed the 272-add-tuple-tests branch from 5bb5b27 to ef394a8 Compare June 12, 2024 15:07
@lifflander lifflander merged commit 2258b37 into develop Jun 18, 2024
18 checks passed
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.

Unit test for std::tuple serialization
3 participants