Path: 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 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