This documentation is archived and is not being maintained.

remove_reference Class

Makes non reference type from type.

template<class Ty>
    struct remove_reference;


The type to modify.

An instance of the type modifier holds a modified-type that is Ty1 when Ty is of the form Ty1&, otherwise Ty.


// std_tr1__type_traits__remove_reference.cpp 
// compile with: /EHsc 
#include <type_traits> 
#include <iostream> 
int main() 
    int *p = (std::remove_reference<int&>::type *)0; 
    p = p;  // to quiet "unused" warning 
    std::cout << "remove_reference<int&> == " 
        << typeid(*p).name() << std::endl; 
    return (0); 
remove_reference<int&> == int

Header: <type_traits>

Namespace: std