🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.tools
Article #499

Re: Use of const keyword - Borland container classes

#499
From: Brad Hines
Date: Fri, 02 Oct 1992 19:08
25 lines
1555 bytes
In article <1992Oct1.215705.1396@aio.jsc.nasa.gov>, bartels@sweetpea.jsc.nasa.gov (Jeff Bartels 283-4167) writes:

> My questions are: 
>
> 1) What meaning does the use of the const modifier have for the
> definition of the member function? I have found no references to this either in
> the Borland manuals, or other C++ books.

> 2) Is this notation a Borland extension to the language? Has it gone before the
> committee that is building the C++ standard?


This is standard C++.  You are apparently already familiar with the
const keyword applied to a function argument (like const _FAR & Object),
which prevents the argument from being modified.  Similarly, if
the const keyword is applied to the member function itself, it means
that the member function may not modify the values of any of the
class object's member variables.  That is, a const member function
has readonly access to other class members.


-- 
Brad Hines
Internet: brad@huey.jpl.nasa.gov
Jet Propulsion Lab, Pasadena, California
Technical Details
Message-ID: <BvID5n.6wD@huey.jpl.nasa.gov>
Path: arc1-ca.pugleaf.net!sparky!uunet!kithrup!hoptoad!pacbell.com!ames!elroy.jpl.nasa.gov!jato!huey!brad
References: <1992Oct1.215705.1396@aio.jsc.nasa.gov>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.tools
Path: arc1-ca.pugleaf.net!sparky!uunet!kithrup!hoptoad!pacbell.com!ames!elroy.jpl.nasa.gov!jato!huey!brad
From: brad@huey.Jpl.Nasa.GOV (Brad Hines)
Subject: Re: Use of const keyword - Borland container classes
Message-ID: <BvID5n.6wD@huey.jpl.nasa.gov>
Sender: news@huey.jpl.nasa.gov
Nntp-Posting-Host: huey
Reply-To: brad@huey.Jpl.Nasa.GOV
Organization: JPL Spatial Interferometry Group
References:  <1992Oct1.215705.1396@aio.jsc.nasa.gov>
Date: Fri, 2 Oct 1992 19:08:10 GMT
Lines: 25