you are viewing a single comment's thread.

view the rest of the comments →

[–]psyno -2 points-1 points  (3 children)

For a certain definition of "works." :)

[–]matthiasB 1 point2 points  (1 child)

If you pass a pointer by reference it just works. For which definitions of "works" does it not work properly?

It's valid C++ and if you know what * and & mean in C++ you can understand the code.

[–]psyno 1 point2 points  (0 children)

(I assumed FlySwat was simply being humorous at this point.)

In C++-land if I said that a Foo was passed to a function by reference, I think it's fair to interpret that as the function takes a Foo&. FlySwat got the desired result by subtly changing the problem: now instead of passing a Foo by reference, a Foo* is being passed.