🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #264

Re: casting "const" to "non-const"

#264
From: ashok p. nadkarni
Date: Fri, 03 Aug 1990 16:51
18 lines
1218 bytes
How about when  a function takes two parameters, one const and the other
non-const. If
the caller passes the same object (by reference or through a pointer)
for each parameter
should it be smart enough to know that the const object may have
actually changed through 
the other parameter ? Or is it the responsibility of the programmer
writing the calling code
(in which case I would never use const for functions taking two or more
parameters of the same type).

I'm learning C++ and have been staying away from const parameters
because I wasn't
sure how a compiler would handle the above case.

Are there any rules that cover this case ?

Ashok Nadkarni
Technical Details
Message-ID: <14208@shlump.nac.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!ashok.nac.dec.com!nadkarni
References: <56265@microsoft.UUCP> <56159@microsoft.UUCP> <56163@microsoft.UUCP> <1913@ux.acs.umn.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!ashok.nac.dec.com!nadkarni
From: nadkarni@ashok.nac.dec.com (ashok p. nadkarni)
Newsgroups: comp.std.c++
Subject: Re: casting "const" to "non-const"
Message-ID: <14208@shlump.nac.dec.com>
Date: 3 Aug 90 16:51:29 GMT
References: <56265@microsoft.UUCP> <56159@microsoft.UUCP> <56163@microsoft.UUCP> <1913@ux.acs.umn.edu>
Sender: news@shlump.nac.dec.com
Reply-To: nadkarni@ashok.nac.dec.com (ashok p. nadkarni)
Organization: Digital Equipment Corporation
Lines: 18