Expand Minimize

remove_reference Class

Makes non reference type from type.

template<class T>
    struct remove_reference;

template<class T>
  using remove_reference_t = typename remove_reference<T>::type;

T

The type to modify.

An instance of remove_reference<T> holds a modified-type that is T1 when T is of the form T1&, otherwise T.

 

#include <type_traits> 
#include <iostream> 
 
int main() 
    { 
    int *p = (std::remove_reference_t<int&> *)0; 
 
    p = p;  // to quiet "unused" warning 
    std::cout << "remove_reference_t<int&> == " 
        << typeid(*p).name() << std::endl; 
 
    return (0); 
    } 
 
remove_reference_t<int&> == int

Header: <type_traits>

Namespace: std

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft