template <class T> struct is_reference;
123
template<class T> struct is_reference : std::integral_constant < bool, is_lvalue_reference<T>::value || is_rvalue_reference<T>::value > {};
123456789101112
// is_reference example #include <iostream> #include <type_traits> int main() { std::cout << std::boolalpha; std::cout << "is_reference:" << std::endl; std::cout << "int: " << std::is_reference<int>::value << std::endl; std::cout << "int&: " << std::is_reference<int&>::value << std::endl; std::cout << "int&&: " << std::is_reference<int&&>::value << std::endl; return 0; }
is_reference: int: false int&: true int&&: true