Some background.
We all used the string class, but some of you might not know that
string is just a typedef of basic_string.
In fact here is the typedef you might find when looking in the XString library.
typedef basic_string<char, char_traits<char>, allocator<char> > string;
This code snippet shows you how to use basic_string to your
advantage. It has almost the same functionality as the string library
but it adds some functionality. It has little error checking. Again this
is shown as an example to learn from. Here is a list of things to
keep in mind :
- template class
- inheritance
- pointer function
- const correctness
- template functions
- scoped namespace
- assert function
- use of typedef