title: Can you make a C++ generic function?
body: <p>Is it possible to create a generic C++ function <code>foo</code>?</p>
  
  <pre><code>foo(Object bar, Object fred)
  {
      //code
  }
  </code></pre>
  
  <p>in which that if the two objects are recognized, they are compared and a comparison value is returned otherwise some other value is returned to indicate a comparison was not possible?</p>
  
  <p>I ask in the case of genericizing a sorting class, in which case you can use this method, and when you derive new objects you want to sort, you add to this foo function, a method on which to sort the new type of Object.</p>