How to pass “literal” integers by reference in C++ (Newbie)

后端 未结 5 484
温柔的废话
温柔的废话 2020-12-03 17:23

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

5条回答
  •  余生分开走
    2020-12-03 17:35

    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?

    Now I'm lost.

提交回复
热议问题