Difference in assignment between values and pointers?
<p>I am seeing huge performance difference in tight loops when I do the following:</p>

<pre><code>MyObject foo = bar.GetObject();
</code></pre>

<p>vs</p>

<pre><code>MyObject* foo = bar.GetObjectPtr();
</code></pre>

<p>Where the specifics of the class functions are:</p>

<pre><code>class MyClass
{
  MyObject someobject;
  MyObject&amp; GetObject() { return someobject; }
  MyObject* GetObjectPtr() { return &amp;someobject; }
} bar;
</code></pre>

<p>The assignment in the first line is considerably slower than the second.  Can someone explain what is going on?  Does this have something to do with the default copy assignment?</p>
