🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2221

Re: Proposal for a new access specifier

#2221
From: Michael Furman
Date: Mon, 16 Oct 1995 16:05
50 lines
2860 bytes
In article <EBIEDERM.95Oct16003412@cse.unl.edu>, ebiederm@cse.unl.edu says...
>  ..... snip .....
>This capability is already in the language, there are no changes
>needed to create it.  There is though the need for a realization that
>you need a seperate type for your variable.

There are a lot of ways to implement something that language does not 
support directly. I do not think that suggesting users to create number
of extra classes is a good thing.

>
>Your example then becomes
>        class Y
>          {
>        public:
>          operator int () { int t; cin t; return t;}
>          int operator = (int arg) { cout << arg; return arg; }
>          }

If I understood you correctly it is not my example but an extra code
needed each time to implement such capability.

>
>So, there isn't a need for a change to allow the capability you want.
>On the other hand there might be call for a standard template class
>that can implement semantics like read only or write only.

And I am not talking just about "read only" and "write only" variables,
but about "variables" that (their values) will be calculated at the read
access time or used for some immediate processing at the write access time.
I see it as extention of traditional variables - in such case "read 
calculation" is just reading from memory (for imbedded types - othervise
using "=" operator or copy constructor) and "write calculation" - writing
to memory.



-----------------------------------------------------------------------------
-------
Michael Furman,                                   (603)893-1109
Geophysical Survey Systems, Inc.              fax:(603)889-3984
13 Klein Drive - P.O. Box 97                      engr@gssi.mv.com 
North Salem, NH 03073-0097                        71543.1334@compuserve.com
-----------------------------------------------------------------------------
-------


[ 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: <DGJs00.Cnq@mv.mv.com>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
References: <199509221547.JAA10782@ncar.ucar.EDU> <MATT.95Sep24112332@Austern> <EBIEDERM.95Oct16003412@cse.unl.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
From: ENGR@GSSI.MV.COM (Michael Furman)
Newsgroups: comp.std.c++
Subject: Re: Proposal for a new access specifier
Date: 16 Oct 1995 16:05:36 GMT
Organization: GSSI
Sender: usenet@mv.MV.COM (System Administrator)
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <DGJs00.Cnq@mv.mv.com>
References: <199509221547.JAA10782@ncar.ucar.EDU> <MATT.95Sep24112332@Austern> <EBIEDERM.95Oct16003412@cse.unl.edu>
NNTP-Posting-Host: taumet.eng.sun.com
Mime-Version: 1.0
Content-Type: text
X-Nntp-Posting-Host: gssi.mv.com
X-Newsreader: WinVN 0.93.10
Apparently-To: comp-std-c++@uunet.MV.COM
Content-Length: 1884
X-Lines: 46
Originator: clamage@taumet