Closed yunxiao3 closed 2 years ago
We felt that having next/seek_* methods return status would be sufficient. There's nothing preventing us from implementing valid() method.
It's true that there's a bit of boilerplate code when using iterators with do/while loop but you can use for loop instead, for example: for (auto s = it.seek_to_first(); s == status::OK; s = it.next())
If you have some other use case where using valid() would be preferred please let us know. Also, if would like to provide a patch with the implementation of a valid()
method that would be very much welcomed :)
Hi @yunxiao3, it's been some time since you opened this question, did you have any thoughts or follow-up comments/questions?
thx
QUESTION:
Details
Why does pmemkv's iterator not support valid? Is there a good way to implement this function, except do while. I think it is very troublesome for the upper layer to call the iterator without the valid API