... function of the list class—enqueue
calls insertAtBack
(line 13), dequeue
calls removeFromFront
(line 18), isQueueEmpty
calls isEmpty
(line 23) and printQueue
calls print
(line 28). As with the Stack
example in Fig. 19.13, this delegation requires explicit use of the this
pointer in isQueueEmpty
and printQueue
to avoid compilation errors.
Get C++ How to Program, 10/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.