home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!newsgate.watson.ibm.com!yktnews!admin!siena!mittle
- From: mittle@watson.ibm.com (Josh Mittleman)
- Subject: Re: const on pass by value
- Sender: news@watson.ibm.com (NNTP News Poster)
- Message-ID: <1992Jul24.172325.25348@watson.ibm.com>
- Date: Fri, 24 Jul 1992 17:23:25 GMT
- Disclaimer: This posting represents the poster's views, not necessarily those of IBM
- References: <1992Jul24.151010.11969@PacBell.COM>
- Nntp-Posting-Host: siena.watson.ibm.com
- Organization: IBM T.J. Watson Research Center
- Lines: 19
-
- In article <1992Jul24.151010.11969@PacBell.COM>, pjcondi@lepton (Paul
- Condie) writes:
-
- > Should pass by value arguments be declared as "const" for
- > good coding style? Or is that nit picking?
-
- A blanket convention makes no sense.
-
- For scalar arguments, it doesn't really matter: The user can see that the
- argument is passed by value, so he doesn't care whether or not it is const.
- If you find it convenient, make it a const.
-
- For struct or class arguments, it may make a difference, and it is
- important to tell the user whether you will change the argument or not.
- Use const appropriately.
-
- ===========================================================================
- Josh Mittleman (mittle@watson.ibm.com)
- J2-C28 T.J. Watson Research Center, PO Box 704, Yorktown Heights, NY 10598
-