title: Should templated classes be precisely as fast as untemplated classes?
body: <p>I have a non-general-purpose object that only exists to be in collections.  A library I'm writing that defines the object, let's call it <code>Collected</code>, and two implementations of the collection, that should have advantages in different scenarios.  Let's call them <code>Collection1</code> and <code>Collection2</code>.  The collection is central to high-speed processing in this application so let's say performance is paramount.</p>
  <p>The code for <code>Collected</code> is identical between the two, except 1) the ctor param that takes its collection, and 2) the member variable storing it.</p>
  <p>So, I'm tempted to replace <code>Collected</code>  with <code>TemplatedCollected&lt;class T&gt;</code> with the obvious code change.
  Apps using the library could decide centrally which they want, and either define <code>MyCollected</code> as <code>TemplatedCollected&lt;Collection1&gt;</code> or <code>TemplatedCollected&lt;Collection2&gt;</code>.</p>
  <p>However if there is <strong>any chance it is any faster</strong>, I could make a <code>Collected1</code> and <code>Collected2</code> class that are identical except which collection they support.  (Again, the app could define <code>MyCollected</code> to their needs.)</p>