title: utf8::next() of utfcpp - tries to iterate past the end of the string
body: <p>I'm using UTFCPP to work with UTF-8 encoded strings stored in std::string objetcs.</p>
  
  <p>I want to iterate over the code points. utf8::next()</p>
  
  <pre><code>uint32_t next(octet_iterator&amp; it, octet_iterator end);
  </code></pre>
  
  <p>seems the way to do this. Here's a test program to illustrate the use:</p>
  
  <pre><code>std::string u8("Hello UTF-8 \u2610\u2193\u2190\u0394 World!\n");
  std::cout &lt;&lt; u8 &lt;&lt; std::endl;
  uint32_t cp = 0;
  std::string::iterator b = u8.begin();
  std::string::iterator e = u8.end();
  while (cp = utf8::next(b,e))
      printf("%d, ", cp);
  </code></pre>
  
  <p>This extracts all the characters fine, however, the program throws a NOT_ENOUGH_ROOM exception, which indicates that "<strong>it</strong> gets equal to <strong>end</strong> during the extraction of a code point" just after printing the 10, which is the ASCII newline control character:</p>
  
  <pre><code>Hello UTF-8 ☐↓←Δ World!
  72, 101, 108, 108, 111, 32, 85, 84, 70, 45, 56, 32, 9744, 8595, 8592, 916, 32, 87, 111, 114, 108, 100, 33, 10,
  terminate called after throwing an instance of 'utf8::not_enough_room'
  what():  Not enough space
  </code></pre>
  
  <p>Obviously, providing the end iterator seems to be insufficient to keep utf8::next from trying to read over the end of the string. </p>
  
  <p>I'm also confused by the utf8::unchecked::next() function, which does not even take an end iterator. How does this know where to stop? Is catching the exception the <em>normal</em> control flow to detect the end of the string?? 
  Obviously I'm missing something.</p>