title: Passing variable by value has the same result as passing it by reference
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  using namespace std;
  int main()
  {
          vector &lt;int&gt; arr {12,13,14,15,16};
          for (auto &amp; x: arr)
          {
                  ++x;
                  cout &lt;&lt; x &lt;&lt; " ";
          }
  
  return 0;
  }
  
  </code></pre>
  
  <p>VS</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  using namespace std;
  int main()
  {
          vector &lt;int&gt; arr {12,13,14,15,16};
          for (auto x: arr)
          {
                  ++x;
                  cout &lt;&lt; x &lt;&lt; " ";
          }
  
  return 0;
  }
  </code></pre>
  
  <p>The output remains the same and we get each value in the vector incrementing by 1. But my text book says this.
  <a href="https://i.stack.imgur.com/gyKtx.png" rel="nofollow noreferrer">Text Book Image</a>
  When my textbooks says "x assumes a copy of each value in the vector" what does that mean? </p>
  
  <p>Here is the code output in a screen shot
  <a href="https://i.stack.imgur.com/SYY8J.png" rel="nofollow noreferrer">Code Output</a>
  The first output being with &amp;
  The second output without &amp;</p>