Skip to content

Turn Expr into a proper range instead of a view - #593

Draft
Krzmbrzl wants to merge 4 commits into
ValeevGroup:masterfrom
Krzmbrzl:make-expr-proper-range
Draft

Turn Expr into a proper range instead of a view#593
Krzmbrzl wants to merge 4 commits into
ValeevGroup:masterfrom
Krzmbrzl:make-expr-proper-range

Conversation

@Krzmbrzl

Copy link
Copy Markdown
Collaborator

Previously, the Expr implementation used range-v3's view facade to
implement range semantics on Expr objects. However, views are different
things from containers which had some more or less subtle consequences.
See also https://stackoverflow.com/a/31462435

This PR replaces the view facade with virtual begin/end
implementations returning ExprIterator objects. Hence, Expr is now a
fully fledged container that is usable as a random-access range.

Previously, the Expr implementation used range-v3's view facade to
implement range semantics on Expr objects. However, views are different
things from containers which had some more or less subtle consequences.
See also https://stackoverflow.com/a/31462435

This commit replaces the view facade with virtual begin/end
implementations returning ExprIterator objects. Hence, Expr is now a
fully fledged container that is usable as a random-access range.
@Krzmbrzl

Copy link
Copy Markdown
Collaborator Author

Okay, I'll have to change the impl to make some protected helper functions like get_begin() & Co which are then called in Expr's base begin()/end() functions to get rid of these ridiculous shadowing issues.

@Krzmbrzl
Krzmbrzl marked this pull request as draft August 19, 2026 18:23
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.

1 participant