What are the benefits to passing integral types by const ref

前端 未结 12 1842
情话喂你
情话喂你 2021-02-05 22:18

The question: Is there benefit to passing an integral type by const reference as opposed to simply by value.

ie.

void foo(const int& n); // case #1
<         


        
12条回答
提交回复
热议问题