Question: The correct implementation for a post-decrement operator for a doubly linked list iterator is (done as an inline function) node_iterator operator --0 { node_iterator original(*this):
The correct implementation for a post-decrement operator for a doubly linked list iterator is (done as an inline function) node_iterator operator --0 { node_iterator original(*this): current = current rightarrow previous(): return original: } node_iterator operator --(int) { node_iterator original(*this): current = current rightarrow previous(): return original: } node_iterator operator --(int) { node_iterator original = current: current = current rightarrow next0: return original: } node_iterator operator --(int) { current = current rightarrow previous(): return *this: }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
