title: Warning C4267 in Visual Studio: 'argument': conversion from 'size_t' to 'const _Elem', possible loss of data
body: <p>I am getting the warning from this function:</p>
  <pre><code>std::pair&lt;size_t, size_t&gt; GetSection(const string&amp; s1, const string&amp; s2) {
          size_t top_section = s1.find(s2 + &quot;:&quot;);
          size_t bottom_section = s1.find(s1.length() - top_section);
  
          return std::make_pair(top_section, bottom_section);
  }
  </code></pre>
  <p>I don't understand what conversion is occurring that is causing the problem.
  I also understand that this function can be written like so:</p>
  <pre><code>    std::pair&lt;size_t, size_t&gt; GetSection(const string&amp; s1, const string&amp; s2) {
          size_t top_section = s1.find(s2 + &quot;:&quot;);
          size_t bottom_section = top_section + s2.length() + 1;
  
          return std::make_pair(top_section, bottom_section);
  }
  </code></pre>
  <p>I just want to know why I am getting this warning.</p>