title: Is it legal to write to std::string?
body: <p>In std::string there are only const members to fetch the data like c_str(). However I can get a reference to the first element of the string via <code>operator[]</code> and I can write to it.</p>
  
  <p>For example, if I have function:</p>
  
  <pre><code>void toupper(char *first,char *last_plus_one);
  </code></pre>
  
  <p>I can write directly to vector getting a pointer to the first element:</p>
  
  <pre><code>vector&lt;char&gt; message // has "Some Message";
  toupper(&amp;message[0],&amp;message[0]+message.size());
  </code></pre>
  
  <p>Can I do same thing with std::string?</p>
  
  <pre><code>string message="Some Message";
  toupper(&amp;message[0],&amp;message[0]+message.size());
  </code></pre>
  
  <p>Does the standard guarantee that the location of the memory is actually linear? ie:</p>
  
  <pre><code>&amp;(*(message.begin()+n)) == &amp;message[n]
  </code></pre>
  
  <p>Thanks.</p>