473,396 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

M I ambiguity

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

Dec 23 '07 #1
2 1309
On Dec 23, 7:11 am, "Fraser Ross" <a...@a.comwrote:
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?
>
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?

Dec 23 '07 #2
"Salt_Peter"
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.
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

Dec 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Terry Hancock | last post by:
What do you do when a date or time is incompletely specified? ISTM, that as it is, there is no formal way to store this --- you have to guess, and there's no way to indicate that the guess is...
11
by: Alexander Stippler | last post by:
Hi I have already posted and discussed the following problems once, but despite really helpful hints I did not get any further with my problem (I at least learned, first to exactly consider why...
21
by: Paul Steckler | last post by:
Here's some code that's giving me differing results, depending on the compiler. typedef foo { int A,B; } FOO; int main() {
0
by: ciaran.mchale | last post by:
I used Google to find information about JAXB 2.0 and I ended up downloading a document called "The Java Architecture for XML Binding (JAXB) 2.0: Proposed Final Draft September 30, 2005". ...
0
by: Alan T | last post by:
I tried to close the word document object and word application: private Interop.Word.Application WordApp; private Interop.Word.Document WordDoc; // close word and quit word application ...
3
by: subramanian100in | last post by:
I have tried the following in VC++ 2005 Express Edition and g++ in Linux. Consider the class class my_complex { public: my_complex(double r, double i = 10.0) : re(r), im(i) { }...
2
by: subramanian100in | last post by:
Consider the program #include <iostream> using namespace std; void fn(const char * str, char x = 'Y') { cout << "from fn(const char *, char) - " << str << endl; return;
10
by: subramanian100in | last post by:
consider the following program: #include <iostream> using namespace std; class my_complex { public: friend ostream & operator<<(ostream &os, const my_complex &c);
4
by: abendstund | last post by:
Hi, I have the following code and trouble with ambiguity due to operator overloading.. The code is also at http://paste.nn-d.de/441 snip>>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.