title: Specifying a function with templates that takes and returns an arbitrary class
body: <p>I'm interested in defining a function that given a class variable, generates and a new instance of the class object with a randomly selected member attribute mutated.</p>
  
  <p>Context: <em>Consider an instance, <code>circle1</code>, of some class, <code>Circle</code>, has attributes <code>color</code> and <code>radius</code>. These attributes are assigned values of <code>red</code> and <code>5</code>, respectively. The function in question, <code>mutate</code>, must accept <code>circle1</code> as an argument, but reject non-class arguments.</em></p>
  
  <p>For other data types, templates provide an answer in this context. That is, templates may be used to specify generic instances of functions that can accept arguments of multiple types.</p>
  
  <p><strong>How can a generic function that accepts (and returns) an instance of any class be defined using templates?</strong> </p>