[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / libcxx / include / __functional / unwrap_ref.h
blobdc309add90df3401ed1791fbd24acd7083edc30f
1 //===----------------------------------------------------------------------===//
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 //===----------------------------------------------------------------------===//
9 #ifndef _LIBCPP___FUNCTIONAL_UNWRAP_REF_H
10 #define _LIBCPP___FUNCTIONAL_UNWRAP_REF_H
12 #include <__config>
14 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15 #pragma GCC system_header
16 #endif
18 _LIBCPP_BEGIN_NAMESPACE_STD
20 template <class _Tp>
21 struct __unwrap_reference { typedef _LIBCPP_NODEBUG _Tp type; };
23 template <class _Tp>
24 class reference_wrapper;
26 template <class _Tp>
27 struct __unwrap_reference<reference_wrapper<_Tp> > { typedef _LIBCPP_NODEBUG _Tp& type; };
29 template <class _Tp>
30 struct decay;
32 #if _LIBCPP_STD_VER > 17
33 template <class _Tp>
34 struct unwrap_reference : __unwrap_reference<_Tp> { };
36 template <class _Tp>
37 using unwrap_reference_t = typename unwrap_reference<_Tp>::type;
39 template <class _Tp>
40 struct unwrap_ref_decay : unwrap_reference<typename decay<_Tp>::type> { };
42 template <class _Tp>
43 using unwrap_ref_decay_t = typename unwrap_ref_decay<_Tp>::type;
44 #endif // > C++17
46 template <class _Tp>
47 struct __unwrap_ref_decay
48 #if _LIBCPP_STD_VER > 17
49 : unwrap_ref_decay<_Tp>
50 #else
51 : __unwrap_reference<typename decay<_Tp>::type>
52 #endif
53 { };
55 _LIBCPP_END_NAMESPACE_STD
57 #endif // _LIBCPP___FUNCTIONAL_UNWRAP_REF_H