🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Use of const keyword - Borland container classes

#497
From: Jeff Bartels 283-4167
Date: Thu, 01 Oct 1992 21:57
31 lines
1508 bytes
I have a question for any of you BC++ users out there: 

I was writing a class that descends directly from the borland Object class. In
order to be able to instantiate from the new class, I have to provide all of the
pure virtual functions that the Object class defines.

The Object class contains member functions which look like this:

virtual int isSortable( const _FAR & Object ) const;
                                              ^^^^^

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?


I also toyed with this construct:


virtual const char *getPointer .....

to attempt to return a "safe" pointer to character strings. Although C++ accepted
this syntax, it did not complain when the code later modified the pointer value.


Any responses?
Technical Details
Message-ID: <1992Oct1.215705.1396@aio.jsc.nasa.gov>
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!cs.utexas.edu!bcm!aio!sweetpea!bartels

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.tools
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!cs.utexas.edu!bcm!aio!sweetpea!bartels
From: bartels@sweetpea.jsc.nasa.gov (Jeff Bartels 283-4167)
Subject: Use of const keyword - Borland container classes
Message-ID: <1992Oct1.215705.1396@aio.jsc.nasa.gov>
Sender: news@aio.jsc.nasa.gov (USENET News System)
Organization: McDonnell Douglas Space Systems Company
Date: Thu, 1 Oct 1992 21:57:05 GMT
Lines: 31