title: clear code for counting from 0 to 255 using 8-bit datatype
body: <p>I was wondering if there is a clean way of counting from 0 to 255 using an 8 bit datatype, something like:</p>
  
  <pre><code>for(uint8_t i(0);i&lt;=255;++i)
  {
      ....
  }
  </code></pre>
  
  <p>This obviously will not work but it makes it clear you want to count from 0 to 255. </p>
  
  <p>A working solution would be something like:</p>
  
  <pre><code>uint8_t i(0);
  do
  {
      ...
      ++i;
  }
  while(i &gt; 0);
  </code></pre>
  
  <p>But here it is not at all clear it counts from 0 to 255.</p>
  
  <p>This will also work but it is just ugly IMHO:</p>
  
  <pre><code>uint8_t i(0);
  while(true)
  {
      ...
      if (i == 255)
      {
          break;
      }
      ++i;
  }
  </code></pre>
  
  <p>So I was wondering, is there a clean way of doing this without using a larger datatype?</p>
  
  <p>EDIT:</p>
  
  <ul>
  <li>I like the version using for because it makes its intend clear without thinking: looping from 0 to 255. All other versions require some thought about what is going on and therefore more likely to confuse others.</li>
  <li>I do not want to use int because the code is for a 8-bit microcontroller with not much memory.</li>
  </ul>