判断是否为右值引用
#include <iostream>
#include <type_traits>
int main()
{
int a = 10;
int& b = a;
std::cout << "This Demo: is_rvalue_reference" << std::endl;
if(std::is_rvalue_reference<int>::value)
{
std::cout << __LINE__ << ": is right value reference" << std::endl;
}
else
{
std::cout << __LINE__ << ": isn't right value reference " << std::endl;
}
if(std::is_rvalue_reference<int&>::value)
{
std::cout << __LINE__ << ": is right value reference" << std::endl;
}
else
{
std::cout << __LINE__ << ": isn't right value reference " << std::endl;
}
if(std::is_rvalue_reference<int&&>::value)
{
std::cout << __LINE__ << ": is right value reference" <