November 1999
Intermediate to advanced
240 pages
5h 22m
English
Difficulty: 5
How usable is the ci_string we created in Item 2? Now we'll focus on usability issues, see what design problems or tradeoffs we encounter, and fill in some of the remaining gaps.
Consider again the solution for Item 2 (ignoring the function bodies):
struct ci_char_traits : public char_traits<char>
{
static bool eq( char c1, char c2 ) { /*...*/ }
static bool lt( char c1, char c2 ) { /*...*/ }
static int compare( const char* s1,
const char* s2,
size_t n ) { /*...*/ }
static const char*
find( const char* s, int n, char a ) { /*...*/ }
};
For this Item, answer the following related questions as completely as possible:
Is it safe to inherit ci_char_traits from char_traits<char> this way?
Why does ...
Read now
Unlock full access