Re: pass by reference



Andreas Leitgeb <avl@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:

As I've tried to show, most of the artefacts that are used to
disprove java's passing by reference, can be mimicked in C++
as well.

As C++ supports both pass by reference and pass by value, that's hardly
surprising. Even if we limit ourselves to pass by reference, though, we will
always be able mimick the behaviour of pass by value by making a local copy
of whatever is referenced.

It's like with diesel and gasoline engines: the difference isn't in what you
can _do_ with them, but in how they _work_. If you're not a language
implementer all you usually just have to make sure of is that you put diesel
on the diesel engine and gasoloine on the gasoline engine.

--
See my previous post for .sig
.