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

后端 未结 5 1137
悲哀的现实
悲哀的现实 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条回答
  •  Happy的楠姐
    2020-12-31 06:15

    Pass by value - definitely. If the system is 64-bit it means it copies 64-bit word extremely fast.

提交回复
热议问题