<分区>
Possible Duplicates:
How to pass objects to functions in C++?
is there any specific case where pass-by-value is preferred over pass-by-const-reference in C++?
我有一个这样实现的类的成员:
void aaa(int a, float b, short c)
{
bbb(a, b);
}
void bbb(int a, float b)
{}
如果 a、b 和 c 的值作为常量存储在我的类中,那么使用我的函数是否更好/明智,如下所示或如上所示?
void aaa(int& a, float& b, short& c)
void bbb(int& a, float& b)
在这种情况下,使用引用是否会带来任何速度优势或优势?这里引用的任何缺点/开销?