title: Why does ranged for loop converts value to ref implicitly?
body: <p>I'm very confused why <code>range-for</code> uses a ref in my example?</p>
  <pre><code>#include &lt;vector&gt;
  #include &lt;unordered_map&gt;
  using namespace std;
  
  int main()
  {
      const unordered_map&lt;char, string&gt; d2c_map= { {'1', &quot;abc&quot;} };
      const string digits{&quot;1&quot;};
      vector&lt;string&gt; R;
          
      for(const auto c : d2c_map.at(digits[0])) {
          R.push_back(c); // &lt;-------------------------???
      } 
      return 0;       
  }
  </code></pre>
  <p>Error indicates that the type of c is <code>const char&amp;</code>:</p>
  <pre><code>error: no matching function for call to 'std::vector&lt;std::__cxx11::basic_string&lt;char&gt; &gt;::push_back(const char&amp;)'
  </code></pre>
  <p><a href="https://godbolt.org/z/jY84sr" rel="nofollow noreferrer">Demo</a></p>