From -9078802690963555941
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,b7c75670fa7d6d63,start
X-Google-Attributes: gidf78e5,public
From: kingsum@mrl001.intel.com (Kingsum Chow)
Subject: Read Only Data Members
Date: 1996/10/14
Message-ID: <KINGSUM.96Oct11132152@mrl001.intel.com>#1/1
X-Deja-AN: 189542467
x-original-date: 11 Oct 1996 20:21:52 GMT
organization: Intel Corp., Hillsboro, Oregon
x-auth: PGPMoose V1.1 PGP comp.std.c++
reply-to: kingsum@ichips.intel.com
newsgroups: comp.std.c++
originator: austern@isolde.mti.sgi.com


Read only data members can be written by member functions but can only
be read by clients.

I can think of two methods to implement it. A conventional one is to
get a `get' function to get the value of a private data
member. Another one is to leave the data member in the public, but
`const' and member functions need to un`const' it when assigning a new
value to it.

In some simulations there are lots of read only data members and both
methods are not satisfactory. Does the new standard of c++ supports
a more convenient way to express read only data members?

Thanks in advance,

Kingsum
--
// #include <standard_disclaimer>
//--------------------------------------
// Kingsum Chow (kingsum@ichips.intel.com)
// MRL JF3-359 (pole: JF3-3H9)
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]



