help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compilation issues with std::string


From: wazz
Subject: Re: Compilation issues with std::string
Date: 13 Feb 2007 23:02:21 -0800
User-agent: G2/1.0

On Feb 12, 10:42 pm, "Grizlyk" <grizl...@yandex.ru> 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
>     const char foo::operator[] (const int i) const { return c_str()[i]; }
>
Ageed, but why is that the issue shows up only for 32-bit compilation
and not for 64-bit, the machine it was compiled on?

I'm doing it this way...its efficient although doesn't look clean :)
char foo::operator [] (const int i) const{    return
std::string::operator[](i);}
char foo::operator [] (const int i) {    return std::string::operator[]
(i);}

Thanks for your explanation.

-Wasif



reply via email to

[Prev in Thread] Current Thread [Next in Thread]