title: NULL terminated string and its length
body: <p>I have a legacy code that receives some proprietary, parses it and creates a bunch of static char arrays (embedded in class representing the message), to represent NULL strings. Afterwards pointers to the string are passed all around and finally serialized to some buffer.</p>
  
  <p>Profiling shows that <code>str*()</code> methods take a lot of time.</p>
  
  <p>Therefore I would like to use <code>memcpy()</code> whether it's possible. To achive it I need a way to associate length with pointer to NULL terminating string. I though about:</p>
  
  <ul>
  <li><p>Using <code>std::string</code> looks less efficient, since it requires memory allocation and thread synchronization.</p></li>
  <li><p>I can use <code>std::pair&lt;pointer to string, length&gt;</code>. But in this case I need to maintain length "manually".</p></li>
  </ul>
  
  <p>What do you think?</p>