title: Does max_size() of std::vector<char> have a bug?
body: <p>I am puzzled by the result of <code>std::vector&lt; char &gt;::max_size()</code> on the <i>n</i> = 32 and <i>n</i> = 64 bits system I have tested. The result is 2<sup><i>n</i></sup> &minus; 1. Let me explain why I am puzzled.</p>
  
  <p>Every implementation of <code>std::vector&lt;T&gt;</code> that I know of has three members of type <code>T*</code>: <code>begin_</code>, <code>end_</code>, <code>capacity_</code>. </p>
  
  <p><code>begin_</code> points to the first value of the vector and <code>end_</code> points to the one after the last. 
  Therefore, the size of the vector is given by <code>end_ - begin_</code>. But the result of this difference is of type <code>std::ptrdiff_t</code> which is a signed integer of <i>n</i> bits on every implementation that I know of. </p>
  
  <p>Therefore, this type can not store 2<sup><i>n</i></sup> &minus; 1, but only up to 2<sup><i>n</i> &minus; 1</sup> &minus; 1. If you look at your <code>std::vector</code> implementation, you'll clearly see that size makes a difference of 2 pointers (before casting it to an unsigned integer). </p>
  
  <p>So, how come they can pretend to store more than 2<sup><i>n</i> &minus; 1</sup> elements without breaking <code>.size()</code>?</p>