Skip to content

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

Merged
Krzmbrzl merged 5 commits into
ValeevGroup:masterfrom
Krzmbrzl:make-expr-proper-range
Aug 20, 2026
Merged

Turn Expr into a proper range instead of a view#593
Krzmbrzl merged 5 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
This avoids the issue of not being able to shadow begin/end in
subclasses as shadowing is not allowed for virtual functions.
@Krzmbrzl
Krzmbrzl marked this pull request as ready for review August 20, 2026 08:36
@Krzmbrzl
Krzmbrzl merged commit 3168a65 into ValeevGroup:master Aug 20, 2026
8 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.

1 participant