Skip to content

Commit

Permalink
Update RingBufferIterator.hpp
Browse files Browse the repository at this point in the history
Add additional comments
  • Loading branch information
hamidb authored Dec 17, 2023
1 parent 54c7a03 commit 1718264
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions c++/design/RingBufferIterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ class RingIterator {
using reference = T&;
using iterator = RingIterator<T, N>;
// _rb(rb) will avoid copying.
// If the definition of a class X does not explicitly declare a move constructor,
// one will be implicitly declared as defaulted if and only if
// X does not have a user-declared copy constructor,
// X does not have a user-declared copy assignment operator,
// X does not have a user-declared move assignment operator,
// X does not have a user-declared destructor, and
// the move constructor would not be implicitly defined as deleted.
RingIterator(RingBuffer<T, N> &rb, int off): _rb(rb), _off(off) {}

iterator& operator++() { // prefix ++
Expand Down

0 comments on commit 1718264

Please sign in to comment.