
14 Feb
2012
14 Feb
'12
8:16 p.m.
Simonson, Lucanus J wrote:
You could say I should have used a reference instead, but it might not have been my pointer to start with.
???
Specifically, polymorphic data types are often passed around by pointer to base class instead of reference to base class by most C++ programmers.
This doesn't convince me. If the pointer can't be zero (and if somebody else owns it), there is no good reason not to use a reference. Well, if the pointer is a class member, using a reference might be impossible. Regards, Thomas