Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ames!decwrl!uunet!cdss!culliton From: culliton@cdss.UUCP (Tom Culliton x2278) Newsgroups: comp.lang.c++ Subject: Re: Why use reference type over pointer type? Summary: Getting the syntax of overloaded operators right... Message-ID: <7@cdss.UUCP> Date: 3 Aug 90 15:15:05 GMT References: <1676@dinl.mmc.UUCP> <1806@cs.rit.edu> Organization: ARINC Research Corp., Annapolis, MD, SRG Group Lines: 20 In article <1806@cs.rit.edu>, jeh@cs.rit.edu (Jim Heliotis) writes: > From article <1676@dinl.mmc.UUCP>, by noren@dinl.uucp (Charles Noren): > > Its obvious, I'm new to C++. > > What does does a reference type give me over a pointer type > > that I've come to love and know well in C? ...... > > I, as a professor, have been asked this so many times that I would love > to hear people's opinions on this. The clearest value that I've found is getting the syntax/semantics of overloaded operators (and some other member functions) right while maintaining the efficiency of pointers. There are some other cases in the development of classes where using a reference "just makes it feel right", Of course I can't clearly state exactly when this is. ;-) Tom ***************************************************************************** * uunet!culliton@cdss - Tom Culliton at Arinc Research Corp. Annapolis MD * * "I haven't lost my mind -- it's backed up on tape somewhere." * *****************************************************************************