title: Intuitive understanding of functions taking references of references
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5481539/what-does-t-mean-in-c11">What does T&amp;&amp; mean in C++11?</a>  </p>
  </blockquote>
  
  
  
  <p>For some reason, this is eluding my intuition, and I cannot find any explanation on the internet. What does it mean for a C++ function to take a reference of a reference?  For example:</p>
  
  <pre><code>void myFunction(int&amp;&amp; val);     //what does this mean?!
  </code></pre>
  
  <p>I understand the idea of passing-by-reference, so</p>
  
  <pre><code>void addTwo(int&amp; a)
  {
      a += 2;
  }
  
  int main()
  {
      int x = 5;
      addTwo(x);
  
      return 0;
  }
  </code></pre>
  
  <p>works and is intuitive to me.</p>