From 17182641a32f83ba8567ddabc0be276caae9a286 Mon Sep 17 00:00:00 2001 From: Hamid Bazargani Date: Sun, 17 Dec 2023 17:52:32 -0500 Subject: [PATCH] Update RingBufferIterator.hpp Add additional comments --- c++/design/RingBufferIterator.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/c++/design/RingBufferIterator.hpp b/c++/design/RingBufferIterator.hpp index 04ff178..fce83b5 100644 --- a/c++/design/RingBufferIterator.hpp +++ b/c++/design/RingBufferIterator.hpp @@ -51,6 +51,13 @@ class RingIterator { using reference = T&; using iterator = RingIterator; // _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 &rb, int off): _rb(rb), _off(off) {} iterator& operator++() { // prefix ++