TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: DANIEL JONES
from: JERRY COFFIN
date: 1997-08-15 18:58:00
subject: Sunir ventures into C++

On (14 Aug 97) Daniel Jones wrote to Jerry Coffin...
 JC> No need for pointers.  You can use actual objects...
 DJ> So you could!  I was so focused on the pointers vs references issue I
 DJ> failed to look at the broader picture.
Right.
 DJ> Still, the ability to return a reference to an object rather than
 DJ> creating and destroying multiple objects demonstrates my point that
 DJ> references are more than "syntactic sugar."
Absolutely.  As I said, performance suffers, probably dramatically,
depending on how expensive it is to create and destroy the objects.
However, it IS possible to do it.
 JC> istream istream::operator(int x) {
 JC> // body
 JC> }
 JC> it'd be able to modify its copy of `x' on the stack, but couldn't
 JC> do _anything_ to the user's original object `x'.
 DJ> Meaning that the programmer would have to pass a pointer rather than
 DJ> the object itself - something like:
 DJ> cin << &Number; 
 DJ> vice 
 DJ> cin << Number;
Umm..maybe:
    cin >> &Number;
versus:
    cin >> Number;
the direction of the "arrow" _does_ make a noticeable difference...
    Later,
    Jerry.
... The Universe is a figment of its own imagination.
--- PPoint 1.90
---------------
* Origin: Point Pointedly Pointless (1:128/166.5)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.