gcc 3.3 operator[] disambiguation

Nathan Sidwell nathan@codesourcery.com
Wed Jun 25 15:18:00 GMT 2003

Alexy Khrabrov wrote:
> I switched from gcc 2.95.3 to 3.3 for MICO 2.3.10,
> a CORBA C++ implementation, and got this most amazing
> error ever:
> MS_EntryFactoryImpl.C:101: error: ISO C++ says that `typename T::ElementType 
>    TSeqVar<T>::operator[](long unsigned int) [with T = 
>    StringSequenceTmpl<CORBA::String_var>]' and `operator[]' are ambiguous even 
>    though the worst conversion for the former is better than the worst 
>    conversion for the latter
> The CORBA Var types precede auto_ptr with the same idea.
> What's funny is there's no parameterless operator[] in their
> declaration for CORBA Sequence Var template.  A CORBA
> Sequence type is like a vector, and the offending line contains
> a simple dereference, like seqV[i] so the mere use of it causes
> a problem!  I wonder what is meant there by "and `operator[]'"?
the builtin operator[]. Do you have a conversion op from TSeqVar<T>
to a pointer?


Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
          The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

More information about the Gcc mailing list