delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/16/12:57:15

From: "Campbell, Rolf [SKY:1U32:EXCH]" <moscoop AT americasm01 DOT nt DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: TABLE OF POINTERS TO FUNCTIONS + OTHER
Date: Thu, 16 Mar 2000 11:11:07 -0500
Organization: Nortel Networks
Lines: 23
Message-ID: <38D1079A.45700792@americasm01.nt.com>
References: <8am435$j8i$1 AT tron DOT sci DOT fi>
NNTP-Posting-Host: wmerh0tk.ca.nortel.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.72 [en] (X11; I; HP-UX B.10.20 9000/785)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Traveler wrote:

> BONUS QUESTION :
>
> When building my new class I have always hated making new version of access
> functions to the various class members.

    Well, my responce is:  Don't use access functions!  I think they are one of
the most over-used, annoying aspects of C++ programming.  And most of the time
they are just used to force 'read-only' for public access.  To start with, I
think this should have been part of the C++ specification (const public: could
mean that outside that classes scope it is treated as const).
    But, since that isn't the case, I've designed a way to make 'read-only'
variables.  It isn't perfect, but it ain't bad either.  It was actually a
spin-off of another idea i had about catching read's/write's for variables and
the read-only one just assert's that you will never read the variable.  If you
want the code, mail me at s257m AT unb DOT ca and ask for it.

--
(\/) Rolf Campbell (\/)



- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019