title: Guarantee that std::container::size_type is a std::size_t
body: <p>Following <a href="https://stackoverflow.com/q/45168636/3378179">this question</a>, I decided to use <code>std::size_t</code> as <code>size_type</code> for every containers, for obvious readability reasons. I know it's theorically possible that <code>std::container&lt;T&gt;::size_type</code> is not <code>std::size_t</code>, but I assume it's not the case on my current and future configurations.</p>
  
  <p>However, in order to avoid wicked bugs, I check the types are the same when I use them. For example:</p>
  
  <pre><code>BOOST_STATIC_ASSERT(boost::is_same&lt; std::vector&lt;double&gt;::size_type , std::size_t &gt;::value);
  std::vector&lt;double&gt; x;
  /* fill x */
  for(std::size_t i = 0; i &lt; x.size(); ++i) { /* do something */ }
  </code></pre>
  
  <p>Another place in the code, I use a <code>std::vector&lt;long int&gt;</code>, then I also check:</p>
  
  <pre><code>BOOST_STATIC_ASSERT(boost::is_same&lt; std::vector&lt;long int&gt;::size_type , std::size_t &gt;::value);
  </code></pre>
  
  <p>And then, oh no! I use <code>std::vector&lt;std::list&lt;std::string&gt;*&gt;</code> and <code>std::vector&lt;std::list&lt;double*&gt;*&gt;</code>, then I check:</p>
  
  <pre><code>BOOST_STATIC_ASSERT(boost::is_same&lt; std::vector&lt;std::list&lt;std::string&gt;*&gt;::size_type , std::size_t &gt;::value);
  BOOST_STATIC_ASSERT(boost::is_same&lt; std::vector&lt;std::list&lt;double*&gt;*&gt;::size_type , std::size_t &gt;::value);
  </code></pre>
  
  <p>Ok, I think you understand the problem. Ugly lines, difficult to maintain the code. It's a bad idea.</p>
  
  <p>Then, my question is: <strong>If I check <code>std::vector&lt;any_common_type&gt;::size_type</code> is a <code>std::size_t</code>, is there any chance that <code>std::vector&lt;another_type&gt;::size_type</code> is NOT <code>std::size_t</code> ? Is it enough to only check some common types in a separated file to be sure <code>std::container::size_type</code> is always <code>std::size_t</code> on my compiler ?</strong></p>
  
  <p><em>Note: I don't use C++11 for compatibility reasons.</em></p>