"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
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
>
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];
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