You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
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.
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!
The text was updated successfully, but these errors were encountered: