xref: /llvm-project/libc/src/__support/CPP/type_traits/remove_reference.h (revision 5ff3ff33ff930e4ec49da7910612d8a41eb068cb)
1 //===-- remove_reference type_traits ----------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 #ifndef LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_REMOVE_REFERENCE_H
9 #define LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_REMOVE_REFERENCE_H
10 
11 #include "src/__support/CPP/type_traits/type_identity.h"
12 #include "src/__support/macros/config.h"
13 
14 namespace LIBC_NAMESPACE_DECL {
15 namespace cpp {
16 
17 // remove_reference
18 template <class T> struct remove_reference : cpp::type_identity<T> {};
19 template <class T> struct remove_reference<T &> : cpp::type_identity<T> {};
20 template <class T> struct remove_reference<T &&> : cpp::type_identity<T> {};
21 template <class T>
22 using remove_reference_t = typename remove_reference<T>::type;
23 
24 } // namespace cpp
25 } // namespace LIBC_NAMESPACE_DECL
26 
27 #endif // LLVM_LIBC_SRC___SUPPORT_CPP_TYPE_TRAITS_REMOVE_REFERENCE_H
28