K
K.S.
Have to clean up an old class library and have a string class with slightly
different functions. The interface I wrote works quite well except the
operator[]! Actually I only need sdl string operator[] but how can I call
it from the derived class. Someone any idea???
class MyString: public std::string
{
reference operator[](size_type n) {return std::string:perator[](n)}
// doesn't work
char& operator[](size_type n) {return std::string:perator[](n)}
// doesn't work
char& operator[](size_type n) {return *this.operator[](n)}
// doesn't work
}
I'd appreciate any ideas! Need it fast! Thanx for any posting!
DevH
different functions. The interface I wrote works quite well except the
operator[]! Actually I only need sdl string operator[] but how can I call
it from the derived class. Someone any idea???
class MyString: public std::string
{
reference operator[](size_type n) {return std::string:perator[](n)}
// doesn't work
char& operator[](size_type n) {return std::string:perator[](n)}
// doesn't work
char& operator[](size_type n) {return *this.operator[](n)}
// doesn't work
}
I'd appreciate any ideas! Need it fast! Thanx for any posting!
DevH