title: std::string::find_first_of does not return the expected value
body: <p>I am trying to create an XML parser in C++. I am currently using cygwin and gcc to compile and gdb to debug. I have this piece of code:</p>
  
  <pre><code>const size_t mDataSize = mData.size();  
  ...  
  size_t ltPos = mData.find_first_of('&lt;', pos);  
  if (ltPos==mData.npos) {  
  ...  
  </code></pre>
  
  <p>mData is declared as private const std::string &amp; within the class and holds the XML file content. After debugging with gdb I found the following:</p>
  
  <pre><code>(gdb) print pos  
  $12 = 636  
  (gdb) print mDataSize  
  $13 = 2692  
  (gdb) n  
  141             size_t ltPos = mData.find_first_of('&lt;', pos);  
  (gdb) print ltPos  
  $14 = 114  
  (gdb) print pos  
  $15 = 636  
  (gdb) n  
  143             if (ltPos==mData.npos)  
  (gdb) print ltPos  
  $16 = 4294967295  
  (gdb) print mData[636]  
  $17 = (const char &amp;) @0xb2b2a8: 10 '\n'  
  (gdb) print mData[637]  
  $18 = (const char &amp;) @0xb2b2a9: 32 ' '  
  (gdb) print mData[638]  
  $19 = (const char &amp;) @0xb2b2aa: 32 ' '  
  (gdb) print mData[639]  
  $20 = (const char &amp;) @0xb2b2ab: 60 '&lt;'  
  </code></pre>
  
  <p>I was expecting 639 as result of calling find_first_of, but I am getting 4294967295 (which is -1 in a signed 32-bit int and matches std::string::npos). Can someone justify this behaviour? Or tell me how to workaround this?</p>