From 2001628651387270261
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,b7c75670fa7d6d63
X-Google-Attributes: gidf78e5,public
From: shh@iv.telecom.at (Stefan H. Holek)
Subject: Re: Read Only Data Members
Date: 1996/10/15
Message-ID: <53vl6e$vb@news.Austria.EU.net>#1/1
X-Deja-AN: 189582973
x-nntp-posting-host: ivdemo.co.at
references: <KINGSUM.96Oct11132152@mrl001.intel.com>
content-length: 908
organization: EUnet EDV DienstleistungsgesmbH, Wien
newsgroups: comp.std.c++
originator: clamage@taumet


In article <KINGSUM.96Oct11132152@mrl001.intel.com>, kingsum@mrl001.intel.com 
says...

>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?

Technically (inline) member functions are *very* satisfactory, IMHO.
If you are referring to the additional typing work, well, that's 
basically not a language problem, is it? I can for example imagine 
an editor macro generating selector member functions.

Regards,
Stefan
-- 
Stefan H. Holek <shh@iv.telecom.at>



























[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]



