Pass by reference vs pass by pointer

This is a discussion on Pass by reference vs pass by pointer within the C++ Programming forums, part of the General Programming Boards category; What is the difference between these two alternatives? Are there performance tradeoffs? Any help appreciated. Examples below.
Code:
//Pass by ...

If I am passing a large vector structure that contains classes that I created, then which way of passing parameters would I use? I am guessing it doesn't matter. Would accessing elements of the vector be faster using one way as opposed to another?

Normally I would pass by reference unless there is a reason to allow for a null value which is probably not the case here. Just make sure it is obvious that the function modifies the argument by using good function and variable names and comments.

> If I am passing a large vector structure that contains classes that I created
Why not try it, and put a trace statement in your copy constructor to see how much it gets hammered when you use pass by value.

Well I already know that pass by value isn't good except for when I am passing small variables around that I don't want the called function to change. I am only curious of the performance difference between pass by reference and pass by pointer (eg address).

> I am only curious of the performance difference between pass by reference and pass by pointer (eg address).
You mean like "none at all" ?
They both share the same underlying implementation as far as most compilers are concerned.

Another advantage of references over pointers is that references are type-safe.

But references can only have one alias right? Meaning after they become referenced to another object they cannot be referenced to another object. I think pointers don't have this limitation. Let me know if I am totally wrong or only partially correct. Thanks

This is correct, but for a function parameter it doesn't really matter. Once you have passed an object to the function, you rarely need to change what the parameter refers to. In fact, this is generally an advantage of the reference in this case, since you don't have to worry about that. You can assume that it refers to a non-null object and that it won't change for the duration of the function.