Article View: comp.std.c++
Article #2951Re: using for whole class
From: John Max Skaller
Date: Tue, 19 Dec 1995 02:51
Date: Tue, 19 Dec 1995 02:51
39 lines
1581 bytes
1581 bytes
clamage@Eng.Sun.COM (Steve Clamage) wrote:
>
>In article 100000@zorglub.cae.ca, dak <pierreba@poster.cae.ca> writes:
>>I recall a conversation on the using keyword but no mention of an answer to
>>this: why isn't it possible to use the using keyword to import a whole class
>>into another ?
>
>What would you want it to mean?
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()
--
John Max Skaller voice: 61-2-566-2189
81 Glebe Point Rd fax: 61-2-660-0850
GLEBE NSW 2037 email: maxtal@suphys.physics.oz.au
AUSTRALIA email: skaller@maxtal.com.au
---
[ 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:
<4b4e2j$752@oznet03.ozemail.com.au>Path:
arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!mattReferences:
<Pine.A32.3.91.951213084350.21973A-100000@zorglub.cae.ca> <4an0br$dea@engnews1.eng.sun.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!matt From: John Max Skaller <maxtal@suphys.physics.su.oz.au> Newsgroups: comp.std.c++ Subject: Re: using for whole class Date: 19 Dec 1995 02:51:50 GMT Organization: MAXTAL Approved: matt@Austern (Matt Austern) Message-ID: <4b4e2j$752@oznet03.ozemail.com.au> References: <Pine.A32.3.91.951213084350.21973A-100000@zorglub.cae.ca> <4an0br$dea@engnews1.eng.sun.com> NNTP-Posting-Host: austern.hip.berkeley.edu