title: Is there a way to overload classes in a way similar to function overloading?
body: <p>We can overload functions by giving them a different number of parameters. For example, functions <code>someFunc()</code> and <code>someFunc(int i)</code> can do completely different things.</p>
  <p>Is it possible to achieve the same effect on classes? For example, having one class name but creating one class if a function is not called and a different class if that function is not called. For example, If I have a <code>dataStorage</code> class, I want the internal implementation to be a list if only <code>add</code> is called, but want it to be a heap if both <code>add</code> and <code>pop</code> are called.</p>
  <p>I am trying to implement this in C++, but I am curious if this is even possible. Examples in other languages would also help. Thanks!</p>