sux-rs
                                
                                 sux-rs copied to clipboard
                                
                                    sux-rs copied to clipboard
                            
                            
                            
                        Implemented double ended iterator for BitFieldVecIterator and associated tests
As per title, I have implemented DoubleEndedIterator for BitFieldVecIterator.
I have added in the test suite a couple of tests to verify that the double-ended iterator works as expected.
I have renamed a method into_iter_from to iter_from_start, and added additionally the methods iter_to_end and iter_range, alongside documentation.
Yes, iter_from and iter_to seem more in line with the rest of the software. What's the failed check?
BTW, thanks for the impl.
Luca, if you could follow these guidelines that would be great. In particular, documentation is in third person.
But I see that now even a normal iterator uses twice the space, and stores twice the reference. I don't think this is a good design—double-ended will be a rare need, and we cannot duplicate the size for that rare case. The whole structure is designed with implementations are light as possible in mind.
You should at least implement a separate structure, ideally storing the reference once, but that would require to copy code from the two unchecked iterator, so let's say that's ok. Still, it would be better to have something like iter_de that returns a double-ended iterator (iter_de_from, etc.).
You can find the benchmarks for the newly added apply_inplace method to update all values of a vector here. It can get to over 4 times faster than by using subsequent get & set operations.
Due to massive refactoring of the main branch this branch is no longer mergeable (besides its reported issues).