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 a union to store common_iterator's members #32

Open
tcbrindle opened this issue Sep 5, 2018 · 0 comments
Open

Use a union to store common_iterator's members #32

tcbrindle opened this issue Sep 5, 2018 · 0 comments

Comments

@tcbrindle
Copy link
Owner

The current implementation of common_iterator stores both the iterator and sentinel as direct members. Since only one of the members can be active at any time, this always wastes space.

P0896 has a note that common_iterator's members should be respecified in terms of std::variant. While we can't use variant (as it's C++17 only), we should use a simple tagged union to avoid making common_iterator twice as big as it needs to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant