Re: Compilation issues with std::string

2007-02-16 Thread Thomas Maeder
"wazz" <[EMAIL PROTECTED]> writes: > I'm trying to define a simple class which extends std::string std::string wasn't designed to serve as a non-private base class ... > , as well as provides a method for C-style typecast. ... and, as a rule, conversion operators are a bad idea because of the

Re: Compilation issues with std::string

2007-02-13 Thread wazz
On Feb 12, 10:42 pm, "Grizlyk" <[EMAIL PROTECTED]> wrote: > wazz wrote: > > > test.cpp: In function `int main()': > > test.cpp:18: error: ISO C++ says that these are ambiguous, > > Ambiguous between inherited "foo::operator[]" and "foo::operator const > char*() + const_char*::operator[]"define >

Re: Compilation issues with std::string

2007-02-12 Thread Grizlyk
wazz wrote: > > test.cpp: In function `int main()': > test.cpp:18: error: ISO C++ says that these are ambiguous, Ambiguous between inherited "foo::operator[]" and "foo::operator const char*() + const_char*::operator[]" define const char foo::operator[] (const int i) const { return c_str()[i];

Compilation issues with std::string

2007-02-12 Thread wazz
Hi, I'm trying to define a simple class which extends std::string, as well as provides a method for C-style typecast. The code snippet is: test.cpp #include #include class foo : public std::string { public: foo(const char * str):std::string(str){} operat