Defined in header <type_traits>

template< class T >
struct remove_reference;

(since C++11)

If the type T is a reference type, provides the member typedef type which is the type referred to by T. Otherwise type is T.

Member types

Name Definition
type the type referred by T or T if it is not a reference

Helper types

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

(since C++14)

Possible implementation

Example

true

false

false

true

true

true

 

 

ref : https://en.cppreference.com/w/cpp/types/remove_reference

반응형

+ Recent posts