Understanding the & operator in templates
<p>so im currently reading <em>sams Teach yourself C++</em> and am unable to figure out when and why the &amp; operator is used, as it seems like it would be uneccesary in many cases like so:</p>

<pre><code>template &lt;typename objectType&gt;   
objectType &amp; GetMax (const objectType &amp; value1, const objectType &amp; value2)    
{
    if (value1 &gt; value2)  
        return value1;    
    else  
        return value2;
};
</code></pre>

<p>Another example:</p>

<pre><code>Template &lt;typename T&gt;  
class myTemplateClass  
{  
public:   
    void SetVariable (T&amp; newValue) {m_Value = newValue; };

    T&amp; GetValue() {return m_Value;};

private:   
    T m_Value;  
};
</code></pre>

<p>Please help me understand why &amp;, which I know gets the address of the data type, is here! its definately not making learning the STL any easier.......... THANKS! =)</p>
