Article View: comp.std.c++
Article #30Re: Ambiguity with Operator::
From: David (Lujun) Shang
Date: Mon, 02 Nov 1992 15:50
Date: Mon, 02 Nov 1992 15:50
22 lines
1470 bytes
1470 bytes
In article <1992Oct31.155805.6176@netcom.com> erc@netcom.com (Eric Smith) writes: > In article <1992Oct22.232803.14743@cadsun.corp.mot.com> shang@corp.mot.com writes: > > b.A::i // scope resolute, resolve in favor of base > > B::A::i // member selector, resolve in favor of member by BC++ > > // scope resolute, resolve in favor of base by MS C/C++ > > B::A::NA // member selector, resolve in favor of member > > > The operator precedence of :: is higher than that of . so b.A::i would > correctly mean the A::i member of object b. I didn't mention any problem of operator"::" with operator".". No problem with their precedence order. The problem is the ambiguious semantics of operator"::". Given an expression "A::B", should "B" be a member (static member or nested class) or a base class? When ambiguity happens, which has the precedence? The member, or the base class? Unfortunately, the rule is not clear. It is quite confused. Daivd Shang
Technical Details
Message-ID:
<1992Nov2.155035.3760@cadsun.corp.mot.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!ftpbox!motsrd!newsReferences:
<1992Oct31.155805.6176@netcom.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c++ Path: arc1-ca.pugleaf.net!sparky!uunet!ftpbox!motsrd!news From: shang@corp.mot.com (David (Lujun) Shang) Subject: Re: Ambiguity with Operator:: Message-ID: <1992Nov2.155035.3760@cadsun.corp.mot.com> Sender: news@cadsun.corp.mot.com Reply-To: shang@corp.mot.com Organization: Motorola, Inc., Software Research and Development, Rolling Meadows, IL. 60008 References: <1992Oct31.155805.6176@netcom.com> Date: Mon, 2 Nov 92 15:50:35 GMT Lines: 23