
From: John Nagle <nagle@animats.com>
Remember, a major purpose of char_string is to stop buffer overflow attacks. It's primarily for retrofit to old code. New code should use <string>.
A buffer overflow occurs when data overwrites allocated memory. A small string optimization class won't encounter that problem unless there is insufficient memory for allocation. Thus, a "never grows" class and a small string optimization class permitting you to determine the stack allocation size solve the overflow problem. (Whether permitting arbitrarily large buffers of incoming data without overflow bugs is beneficial is another matter.) -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;