home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!haven.umd.edu!wam.umd.edu!krc
- From: krc@wam.umd.edu (Kevin R. Coombes)
- Subject: Re: Overloading Operators
- Message-ID: <1993Jan25.174819.18445@wam.umd.edu>
- Sender: usenet@wam.umd.edu (USENET News system)
- Nntp-Posting-Host: rac1.wam.umd.edu
- Organization: University of Maryland, College Park
- References: <727392166snx@trmphrst.demon.co.uk> <C13BK9.Lr@frumious.uucp> <2215@celia.UUCP>
- Date: Mon, 25 Jan 1993 17:48:19 GMT
- Lines: 16
-
- In article <2215@celia.UUCP> celia!gray@usc.edu (Steve Gray) writes:
- >A const reference differs in a very important way from a plain reference:
- >it clearly states that the member function has no side effects. One of
- >my (and others at R&H's) primary objections to using references is that
- >it means member functions can have un-obvious side effects on their parameters.
- >i.e. they can change the contents of a variable which was passed by value (as
- >far as the caller's syntax is concerned) and therefor should not be changed by
- >the member function.
- >
- >We have basically outlawed non-const references as being too dangerous. I
- >personally would have preferred that they not even be allowed in the language,
- >but I can understand why (given the syntax of the language) they are allowed.
-
- Have you also outlawed pointers (to non-const objects) as parameters?
-
- Kevin Coombes <krc@math.umd.edu>
-