> This is why C++ code should use references more and pointers less.
I'd agree except that using references leaves no hint at call sites that a reference is being passed. If you're using pointers, the pointer sigil (&) at call sites can serve as a really obvious signpost that something non-trivial is going on.
(This is really unfortunate, IMO, but there's no changing it at this point.)
I'd agree except that using references leaves no hint at call sites that a reference is being passed. If you're using pointers, the pointer sigil (&) at call sites can serve as a really obvious signpost that something non-trivial is going on.
(This is really unfortunate, IMO, but there's no changing it at this point.)