
18 Aug
2008
18 Aug
'08
9:50 a.m.
Picking up on one of Dave's comments, do you put a test in every function that takes a pointer to test whether you have been passed a null?
If the pointer would be guaranteed to be nonzero, I would prefer to use a reference (in the function signature) instead of a pointer. I admit that it's not always possible to use references, because pointer arithmetic is not applicable to references. But in this case, an iterator would be more suitable than a pointer.