j***i 发帖数: 1278 | 1 I copy the following code from the book and complied in gcc
struct ci_char_traits : public char_traits
// here it have errors
//
//
// error: expected template-name before ‘<’ token
// error: expected `{' before ‘<’ token
// error: expected unqualified-id before ‘<’ token
{
static bool eq( char c1, char c2 )
{ return toupper(c1) == toupper(c2); }
static bool lt( char c1, char c2 )
{ return toupper(c1) < toupper(c2); }
static int compare( const char* s1,
| t****t 发帖数: 6806 | 2 public std::char_traits
【在 j***i 的大作中提到】 : I copy the following code from the book and complied in gcc : struct ci_char_traits : public char_traits : // here it have errors : // : // : // error: expected template-name before ‘<’ token : // error: expected `{' before ‘<’ token : // error: expected unqualified-id before ‘<’ token : { : static bool eq( char c1, char c2 )
|
|