Difference between "Adaptor" and "Sub-Class"

I'm currently reading about adaptors (example. stack, queue, deque).

My question: A deque, for example, is an adaption of a double-linked list. How does this differ from making deque a sub-class of double-linked list?
Last edited on
Deriving one class from another ususally only makes sense if you want to extent functionality of the base class. That is when you overwrite virtual functions. STL doesn't have that 'virtual' approach
True. I forget that object-oriented code is not just about functionality - it is also meant to clearly express intent/ideas as well. Deriving deque from a double-linked list implies that "deque is a double-linked list", which is not correct.

Thanks!
Last edited on
Topic archived. No new replies allowed.