I understand the syntax and general semantics of pointers versus references, but how should I decide when it is more-or-less appropriate to use references or pointers in an
My rule of thumb is:
&
)const
if it's an incoming parameter)const T&
).int ¤t = someArray[i]
)Regardless which one you use, don't forget to document your functions and the meaning of their parameters if they are not obvious.