Standard container inheritance is, in general, considered a design flaw and should be avoided, as is private inheritance. In this article, I’ll discuss what I consider a good usage of standard container inheritance and private inheritance using the k‑smallest problem.




K‑Smallest Problem


Suppose you want to keep the k‑smallest values...