Skip to content

Use a union to store common_iterator's members #32

@tcbrindle

Description

@tcbrindle

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions