C++: remove_cvref
개요
- 상수성과 레퍼런스를 제거
예제
- 코드
#include <iostream>
#include <type_traits>
using namespace std;
int main() {
cout << is_same_v<remove_cvref_t<int>, int> << endl;
cout << is_same_v<remove_cvref_t<int &>, int> << endl;
cout << is_same_v<remove_cvref_t<int &&>, int> << endl;
cout << is_same_v<remove_cvref_t<const int &>, int> << endl;
return 0;
}
- 실행 결과
1
1
1
1