Skip to content

Conversation

petelilley
Copy link
Contributor

Changes to circular_buffer and static_circular_buffer:

  • Made iterator and const_iterator bidirectional
  • Added reverse_iterator and const_reverse_iterator using std::reverse_iterator<>
  • Added relevant rbegin(), rend(), crbegin(), crend() functions
  • Added unit tests for both iterators

I also added comments to circular_buffer to match the ones in static_circular_buffer

Use std::reverse_iterator<> to create reverse iterators, make other
iterators bidirectional to allow for this. Added unit tests
@github-actions github-actions bot added the component: wpiutil WPI utility library label Oct 4, 2025
Copy link
Member

@calcmogul calcmogul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The const iterator getters are inconsistent about whether they say they return a "const iterator" or not. It's probably best to include the const where applicable.

Updated comments for const iterator getter functions
@petelilley
Copy link
Contributor Author

Comments are updated

@PeterJohnson PeterJohnson merged commit f1b9be5 into wpilibsuite:main Oct 4, 2025
44 checks passed
@petelilley petelilley deleted the circular-buffer-reverse-iterators branch October 4, 2025 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: wpiutil WPI utility library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants