Is there a reason to use templates while implementing a SetMember method?
<p>While browsing our code, I noticed this:</p>

<pre><code>class foo
{
  public:
      template &lt;typename T&gt;
      void SetBar(T&amp;&amp; otherBarInstance) { m_barInstance = std::forward&lt;T&gt;(otherBarInstance); }

  private:
      bar m_barInstance;  
};
</code></pre>

<p>In what scenarios (meaning, for what <code>T</code>'s) this would work other than for <code>T == bar</code>? (as far as I know, classes that derive from <code>bar</code> would fail since <code>m_barInstance</code> isn't declared as <code>bar&amp;</code>)</p>

<p>Also , since <code>m_barInstance</code> is declared as <code>bar</code> and not as <code>bar&amp;</code> , does the <code>std::forward</code> have any meaning here?</p>