title: Optimal iteration though char string
body: <p>This derived from <a href="https://stackoverflow.com/questions/17991135/is-there-a-better-more-efficient-way-to-find-if-a-string-can-be-formed-from-ch/17991670#17991670">other question</a>. If we have:</p>
  
  <pre><code>const std::string&amp; S = ...;
  int freq[CHAR_MAX-CHAR_MIN+1]={0};
  </code></pre>
  
  <p>Are following four loops are equivalent? What do you like better?</p>
  
  <pre><code>for (int           c: S) ++freq[c-CHAR_MIN];  // (1)
  for (char          c: S) ++freq[c-CHAR_MIN];  // (2)
  for (unsigned      c: S) ++freq[c];           // (3) &lt;-- BAD!
  for (unsigned char c: S) ++freq[c];           // (4)
  </code></pre>