Edit: As many people have pointed out, pass-by-reference isn\'t generally appropriate as an optimisation for primitive types. This is excellent to know, so
You seem to already be familiar with the problems of copy-by-value, so you've eliminated copy-by-value. And now you're confused that passing raw values fails?