[ZOOM] C++ pointers

Mike Taylor mike at tecc.co.uk
Thu Nov 1 16:14:03 CET 2001


> Date: Thu, 1 Nov 2001 15:04:10 +0000
> From: Ashley Sanders <zzaascs at irwell.mimas.ac.uk>
> 
> > If we go the way we seem to be going with the resultSet constructor,
> > then we will presumably do the same with the record constructor, which
> > will replace the resultSet::getRecord() method.  Then your code could
> > be written:
> > 
> > 	for (size_t sz = 0; sz < rs.size (); ++sz)
> > 	  cout << record(rs, sz)->field ("title") << endl;
> > 
> > At least, I think it can.
> 
> No. For the polymorphic behaviour we've designed into
> the record heirarchy you need a reference or a pointer.
> Stroustup, 3rd ed, page 312.

Right.

> Personally I feel more at ease with pointers, but that's probably
> because I started off with C.

Me too, but& I &admit I am beginning to understand& some of& the reasons
why most C++ program &look& like someone's &sprinkled a handful& of
ampersands &liberally over them& :-)

 _/|_	 _______________________________________________________________
/o ) \/  Mike Taylor   <mike at miketaylor.org.uk>   www.miketaylor.org.uk
)_v__/\  "We pay too high a price for Unity if it costs us the Truth"
	 -- Arthur Wallis.




More information about the ZOOM mailing list