Article View: comp.std.c++
Article #2213Re: Proposal for a new access specifier
From: Eric Biederman
Date: Mon, 16 Oct 1995 08:46
Date: Mon, 16 Oct 1995 08:46
36 lines
2005 bytes
2005 bytes
ENGR@GSSI.MV.COM (Michael Furman) writes:
...
>>Instead, there would simply be attributes, which could be accessed
>>(i.e. square.Area). Whether these were implemented as a data member or
>>as a function (i.e. { return height * width; }) is not particularly
>>relevent to the caller, so why should he specify "Area()" rather than
>>simply "Area".
>It is so close to my ideal. But I have one addition. You described "abstract
>read source interface". I would like to have also "write interface": to let
>caller write just "square.Area = 10;" instead of "square.Change_Area(10)".
But you can already do this. Not across the board, but you can do it
if you want. Just make each attribute a class of it's own. You can
then overload operator = and operator int and say all of that.
You would probably want to make all of your attributes a class hiarchy
so that you could change their implementations, etc, etc.
There is not a need to have this in the standard.
It's already there. (In a C++ way)
In article <m0t4Dmy-000glNC@axpblib> martelli@cadlab.it (Alex Martelli) writes:
(Personally, it's one of their few choices
that I _dis_like, so, I'm _quite_ happy that C++ doesn't have it:-).
But it does!
---
[ 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:
<EBIEDERM.95Oct16010202@cse.unl.edu>Path:
arc1-ca.pugleaf.net!news.duke.edu!agate!agate!MattReferences:
<199509221547.JAA10782@ncar.ucar.EDU> <MATT.95Sep24112332@Austern> <44spqj$j37@nn.fast.net> <DG6q6J.EEt@mv.mv.com> <m0t4Dmy-000glNC@axpblib>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.duke.edu!agate!agate!Matt From: ebiederm@cse.unl.edu (Eric Biederman) Newsgroups: comp.std.c++ Subject: Re: Proposal for a new access specifier Date: 16 Oct 1995 08:46:59 GMT Organization: University of Nebraska--Lincoln Approved: Matt@Austern Message-ID: <EBIEDERM.95Oct16010202@cse.unl.edu> References: <199509221547.JAA10782@ncar.ucar.EDU> <MATT.95Sep24112332@Austern> <44spqj$j37@nn.fast.net> <DG6q6J.EEt@mv.mv.com> <m0t4Dmy-000glNC@axpblib> NNTP-Posting-Host: austern.hip.berkeley.edu