C++ 64 bit int: pass by reference or pass by value

后端 未结 5 1130
悲哀的现实
悲哀的现实 2020-12-31 05:46

This is an efficiency question about 64 bit ints. Assuming I don\'t need to modify the value of a \"int\" parameter, should I pass it by value or reference.

Assu

5条回答
  •  情话喂你
    2020-12-31 06:15

    Even on a 64 bit machine pass by value is better (with some very few exceptions), because it can be passed as a register value.

提交回复
热议问题