64,654
社区成员
发帖
与我相关
我的任务
分享
void test(int& i)
{
}
void constRefTest(const int& i)
{
}
int main()
{
int i = 8;
// test(2); // 错误
test(i); // 正确
constRefTest(6); // 正确,隐式转化
constRefTest(i); // 正确
return 0;
}