Skip to content

Add Range.overlaps(Range) to test for a nonempty intersection - #8649

Open
Gosling-dude wants to merge 1 commit into
google:masterfrom
Gosling-dude:range-overlaps
Open

Add Range.overlaps(Range) to test for a nonempty intersection#8649
Gosling-dude wants to merge 1 commit into
google:masterfrom
Gosling-dude:range-overlaps

Conversation

@Gosling-dude

Copy link
Copy Markdown

Fixes #2094

@google-cla

google-cla Bot commented Aug 31, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Adds a boolean overlaps(Range<C> other) that returns true iff the two
ranges share at least one value, i.e. isConnected(other) && the
intersection is non-empty. Empty ranges overlap nothing, including
themselves.

Fixes google#2094
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.

add Range.overlaps(Range) method

1 participant