左值引用推导
unreal吧
全部回复
仅看楼主
level 8
模版参数列表参加&
template<class T>
void testRef(T& x)
{
}
int aa = 10
testRef(aa)
内部改外部也改
const int bb
内部是别名 , 内部改值报错
testRef(10) 不行直接报错,只能左值进去
-----------
void h(const T& x)
1、可以接受左值右值
const 内部不能修改
2026年09月11日 06点09分 1
1