Warning: This file is not a C or C++ file. It does not have highlighting.

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//===----------------------------------------------------------------------===//
8
9#ifndef _LIBCPP___TYPE_TRAITS_UNWRAP_REF_H
10#define _LIBCPP___TYPE_TRAITS_UNWRAP_REF_H
11
12#include <__config>
13#include <__fwd/functional.h>
14#include <__type_traits/decay.h>
15
16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17# pragma GCC system_header
18#endif
19
20_LIBCPP_BEGIN_NAMESPACE_STD
21
22template <class _Tp>
23struct __unwrap_reference {
24 using type _LIBCPP_NODEBUG = _Tp;
25};
26
27template <class _Tp>
28struct __unwrap_reference<reference_wrapper<_Tp> > {
29 using type _LIBCPP_NODEBUG = _Tp&;
30};
31
32template <class _Tp>
33using __unwrap_ref_decay_t _LIBCPP_NODEBUG = typename __unwrap_reference<__decay_t<_Tp> >::type;
34
35#if _LIBCPP_STD_VER >= 20
36template <class _Tp>
37struct _LIBCPP_NO_SPECIALIZATIONS unwrap_reference : __unwrap_reference<_Tp> {};
38
39template <class _Tp>
40using unwrap_reference_t = typename unwrap_reference<_Tp>::type;
41
42template <class _Tp>
43struct _LIBCPP_NO_SPECIALIZATIONS unwrap_ref_decay : unwrap_reference<__decay_t<_Tp> > {};
44
45template <class _Tp>
46using unwrap_ref_decay_t = __unwrap_ref_decay_t<_Tp>;
47#endif // _LIBCPP_STD_VER >= 20
48
49_LIBCPP_END_NAMESPACE_STD
50
51#endif // _LIBCPP___TYPE_TRAITS_UNWRAP_REF_H
52

Warning: This file is not a C or C++ file. It does not have highlighting.

source code of libcxx/include/__type_traits/unwrap_ref.h