Connecting Tech Pros Worldwide Forums | Help | Site Map

M I ambiguity

Fraser Ross
Guest
 
Posts: n/a
#1: Dec 23 '07
struct B1 {
void f();
static void f(int);
int i;
};
struct B2 {
void f(double);
};
struct I1: B1 { };
struct I2: B1 { };
struct D: I1, I2, B2 {
using B1::f;
using B2::f;
void g() {
f(); // Ambiguous conversion of this
f(0); // Unambiguous (static)
f(0.0); // Unambiguous (only one B2)
int B1::* mpB1 = &D::i; // Unambiguous
int D::* mpD = &D::i; // Ambiguous conversion
}
};

In the second last statement there is surely ambiguity? It is not
possible to disambiguate i because of arguably a weakness in the
language.

In the last statement I don't think there is a conversion.

This is from the propsed resolution N1626.

Fraser.



--
Posted via a free Usenet account from http://www.teranews.com


Salt_Peter
Guest
 
Posts: n/a
#2: Dec 23 '07

re: M I ambiguity


On Dec 23, 7:11 am, "Fraser Ross" <a...@a.comwrote:
Quote:
struct B1 {
void f();
static void f(int);
int i;};
>
struct B2 {
void f(double);};
>
struct I1: B1 { };
struct I2: B1 { };
struct D: I1, I2, B2 {
using B1::f;
using B2::f;
void g() {
f(); // Ambiguous conversion of this
f(0); // Unambiguous (static)
f(0.0); // Unambiguous (only one B2)
int B1::* mpB1 = &D::i; // Unambiguous
int D::* mpD = &D::i; // Ambiguous conversion
>
}
};
>
In the second last statement there is surely ambiguity? It is not
possible to disambiguate i because of arguably a weakness in the
language.
A weakness or a feature? What are accessors employed for?
Quote:
>
In the last statement I don't think there is a conversion.
>
This is from the propsed resolution N1626.
>
Fraser.
>
The last two show up as ambiguous here. Which makes sense.
Does N1626 not propose a phrase that states such a situation is ill-
formed anyway?

Fraser Ross
Guest
 
Posts: n/a
#3: Dec 24 '07

re: M I ambiguity


"Salt_Peter"
Quote:
Quote:
In the second last statement there is surely ambiguity? It is not
possible to disambiguate i because of arguably a weakness in the
language.
>
A weakness or a feature? What are accessors employed for?
It isn't possible to disambiguate between non-virtual common base
classes. An access specification specifies a class not a subobject.


Quote:
The last two show up as ambiguous here. Which makes sense.
Does N1626 not propose a phrase that states such a situation is ill-
formed anyway?
Its demonstrating amibiguity when there is no ambiguity with name
lookup.

Fraser.



--
Posted via a free Usenet account from http://www.teranews.com

Closed Thread