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

Does the iterator of ConcurrentSkipList support the -- operator? #2013

Open
wqshr12345 opened this issue Jun 6, 2023 · 2 comments
Open

Does the iterator of ConcurrentSkipList support the -- operator? #2013

wqshr12345 opened this issue Jun 6, 2023 · 2 comments

Comments

@wqshr12345
Copy link

Hello!
I have a requirement to find the smallest element greater than a given key and the largest element smaller than the key.
Initially, I expected to use the lower_bound() method of Accessor to get the iterator of the first element greater than or equal to the key, and then decrement it to obtain the iterator of the first element smaller than the key. However, when I was writing the code, I found that the iterator does not support the -- operator.
Do you have any good suggestions on how to implement my requirement? Thank you!

@Leumim2020
Copy link

Hello!
I have a requirement to find the smallest element greater than a given key and the largest element smaller than the key.
Initially, I expected to use the lower_bound() method of Accessor to get the iterator of the first element greater than or equal to the key, and then decrement it to obtain the iterator of the first element smaller than the key. However, when I was writing the code, I found that the iterator does not support the -- operator.
Do you have any good suggestions on how to implement my requirement? Thank you!

Hi, do you can sent your code? because that makes it difficult to help

Because iterators has suport the ++, --, but depends in how you are make.

@Leumim2020
Copy link

Do you can sent the your code?

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

2 participants