Article View: comp.std.c++
Article #2956Re: using for whole class
From: Ajay Kamdar
Date: Wed, 20 Dec 1995 18:32
Date: Wed, 20 Dec 1995 18:32
42 lines
1631 bytes
1631 bytes
In article <4b4e2j$752@oznet03.ozemail.com.au>,
John Max Skaller <maxtal@suphys.physics.su.oz.au> wrote:
>
>Well, now you ask, I'd like to be able to use an _expression_
>in a class -- to implement delegation. For example:
>
> class W { void g(); };
> class X { void f(); };
> class Y {
> X x;
> W *pw;
> using x;
> using *pw;
> };
>
> Y y;
> y.f(); // OK, means y.x.f()
> y.g(); // OK, means (*y.pw).g()
Yeah right, like we really need to grow the language even more by
providing for new ambiguities:
struct W {
void g();
void f(); // new member function to W
};
struct X .... // similar to above example
struct Y .... // similar to above example
Y y;
y.f(); // Ambiguity: y.x.f()? Or (*y.pw).f()?
--
Ajay Kamdar | Email: ajay@lehman.com | Standard Disclaimer
Lehman Brothers | Phone: (201) 524-5048 |
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<4b94rv$4qn@jabba.lehman.com>Path:
arc1-ca.pugleaf.net!newsxfer2.itd.umich.edu!agate!agate!mattReferences:
<Pine.A32.3.91.951213084350.21973A-100000@zorglub.cae.ca> <4an0br$dea@engnews1.eng.sun.com> <4b4e2j$752@oznet03.ozemail.com.au>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!newsxfer2.itd.umich.edu!agate!agate!matt From: ajay@lehman.com (Ajay Kamdar) Newsgroups: comp.std.c++ Subject: Re: using for whole class Date: 20 Dec 1995 18:32:06 GMT Organization: Lehman Brothers, Inc. Approved: matt@Austern (Matt Austern) Message-ID: <4b94rv$4qn@jabba.lehman.com> References: <Pine.A32.3.91.951213084350.21973A-100000@zorglub.cae.ca> <4an0br$dea@engnews1.eng.sun.com> <4b4e2j$752@oznet03.ozemail.com.au> NNTP-Posting-Host: austern.hip.berkeley.edu