std::remove_reference (3) - Linux Manuals
std::remove_reference: std::remove_reference
NAME
std::remove_reference - std::remove_reference
Synopsis
Defined in header <type_traits>
template< class T > (since C++11)
struct remove_reference;
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 > (since C++14)
using remove_reference_t = typename remove_reference<T>::type;
Possible implementation
Example
// Run this code
Output:
See also
is_reference checks if a type is either a lvalue reference or rvalue reference
(C++11)
add_lvalue_reference
add_rvalue_reference adds a lvalue or rvalue reference to the given type
(C++11)
(C++11)
remove_cvref combines std::remove_cv and std::remove_reference
(C++20)