title: When is the use of std::ref necessary?
body: <p>Consider:</p>
  
  <pre><code>std::tuple&lt;int , const A&amp;&gt; func (const A&amp; a) 
  {
    return std::make_tuple( 0 , std::ref(a) );
  }
  </code></pre>
  
  <p>Is the <code>std::ref</code> required for writing correct and portable code? (It compiles fine without it)</p>
  
  <p>Background:</p>
  
  <p>If I remove <code>std::ref</code> my code builds fine without any warnings (<code>g++-4.6 -Wall</code>), but doesn't run correctly.</p>
  
  <p>In case of interest the definition of <code>A</code>:</p>
  
  <pre><code>struct A {
    std::array&lt;int,2&gt; vec;
    typedef int type_t;
  
    template&lt;typename... OPs,typename... VALs&gt;
    A&amp; operator=(const std::pair&lt; std::tuple&lt;VALs...&gt; , std::tuple&lt;OPs...&gt; &gt;&amp; e) {
      for( int i = 0 ; i &lt; vec.size() ; ++i ) {
        vec[i] = eval( extract(i,e.first) , e.second );
      }
    }
  };
  </code></pre>