decltype(auto) f()
{
int x = 0;
return (x)
}
얘는 int&를 리턴함
decltype(auto) f()
{
int x = 0;
return x;
}
얘는 int를 리턴함
단순 변수명이 아니라 expression인 경우에 decltype이 레퍼런스를 호출하기 때문이라는데
머리 아프네..
decltype(auto) f()
{
int x = 0;
return (x)
}
얘는 int&를 리턴함
decltype(auto) f()
{
int x = 0;
return x;
}
얘는 int를 리턴함
단순 변수명이 아니라 expression인 경우에 decltype이 레퍼런스를 호출하기 때문이라는데
머리 아프네..
댓글 0