Problem with overload resolution.

Niall Smart njs3@doc.ic.ac.uk
Sun May 24 07:59:00 GMT 1998


On May 23,  7:41pm, scott snyder wrote:
} Subject: Problem with overload resolution.

Hi,

> The compiler appears to be choosing the wrong candidate for the
> overloaded end() method in this instance.  The error goes away
> if the declaration
> 
>   ci end() const;
> 
> is removed.
> 
> This seems to me to be incorrect according to the rules in [over.ics.rank]:
> 
>   --Standard conversion sequence S1 is a better conversion sequence than
>     standard conversion sequence S2 if
> 
>     --S1 and S2 differ only in their qualification conversion and  yield
>       similar  types  T1 and T2 (_conv.qual_), respectively, and the cv-
>       qualification signature of type T1 is a proper subset of  the  cv-
>       qualification signature of type T2, [Example:
>                   int f(const int *);
>                   int f(int *);
>                   int i;
>                   int j = f(&i);    // Calls f(int *)

I'm not familiar with the legalese used the standard, so perhaps
I'm out of my depth here, but do the two end() members return
"similar types"?

class it {};
class ci {};

class list {
public:
  it end();
  ci end() const;


Niall



More information about the Gcc-bugs mailing list