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

Eq requirement for V #68

Open
rongcuid opened this issue Apr 10, 2023 · 5 comments
Open

Eq requirement for V #68

rongcuid opened this issue Apr 10, 2023 · 5 comments

Comments

@rongcuid
Copy link

Is Eq really needed for the value type? Std maps like HashMap and BTreeMap does not pose any assumptions on the values except when implementing PartialEq and Eq, respectively.

@ripytide
Copy link

I think it's needed for the insert() method to decide whether to coalesce adjacent or overlapping ranges. Which doesn't apply to BTreeMap or HashMap.

@rongcuid
Copy link
Author

But what about values that don't implement Eq? Implementation aside, would it still be a valid range map?

@ripytide
Copy link

You could indeed have a valid range map even if the value doesn't implement Eq range_bounds_map allows this for example.

@jeffparsons
Copy link
Owner

Thanks for answering this, @ripytide.

I do plan to make coalescing (and therefore the Eq bound) opt-in eventually, but I can't promise any timelines at the moment.

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

No branches or pull requests

4 participants
@jeffparsons @rongcuid @ripytide and others