Re: operator[] ambiguous

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

 



Michael Gong <gongweigang@xxxxxxxxx> writes:
> If I compile with g++, it has following error message:
>
>  ISO C++ says that `char& A::operator[](unsigned int)' and
> `operator[]' are ambiguous even though the worst conversion for the
> former is better than the worst conversion for the latter

What version of g++ are you using?

I tried compiling your example with every version of g++ I have on this
system (4.3.5, 4.4.4, 4.5.1, and 4.6/trunk), and none gave an error (and
looking at the result, all seem to be using the A::operator[] method).

-Miles

-- 
Joy, n. An emotion variously excited, but in its highest degree arising from
the contemplation of grief in another.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux