File tree 2 files changed +16
-14
lines changed
libcxx/include/__type_traits 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 10
10
#define _LIBCPP___TYPE_TRAITS_REMOVE_CV_H
11
11
12
12
#include < __config>
13
+ #include < __type_traits/remove_const.h>
14
+ #include < __type_traits/remove_volatile.h>
13
15
14
16
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15
17
# pragma GCC system_header
16
18
#endif
17
19
18
20
_LIBCPP_BEGIN_NAMESPACE_STD
19
21
22
+ #if __has_builtin(__remove_cv) && !defined(_LIBCPP_COMPILER_GCC)
20
23
template <class _Tp >
21
24
struct remove_cv {
22
25
using type _LIBCPP_NODEBUG = __remove_cv(_Tp);
23
26
};
24
27
25
- #if defined(_LIBCPP_COMPILER_GCC)
26
28
template <class _Tp >
27
- using __remove_cv_t = typename remove_cv< _Tp>::type ;
29
+ using __remove_cv_t = __remove_cv( _Tp) ;
28
30
#else
29
31
template <class _Tp >
30
- using __remove_cv_t = __remove_cv(_Tp);
31
- #endif
32
+ struct _LIBCPP_TEMPLATE_VIS remove_cv {
33
+ typedef __remove_volatile_t <__remove_const_t <_Tp> > type;
34
+ };
35
+
36
+ template <class _Tp >
37
+ using __remove_cv_t = __remove_volatile_t <__remove_const_t <_Tp> >;
38
+ #endif // __has_builtin(__remove_cv)
32
39
33
40
#if _LIBCPP_STD_VER >= 14
34
41
template <class _Tp >
Original file line number Diff line number Diff line change 20
20
21
21
_LIBCPP_BEGIN_NAMESPACE_STD
22
22
23
- #if defined(_LIBCPP_COMPILER_GCC)
23
+ #if __has_builtin(__remove_cvref) && ! defined(_LIBCPP_COMPILER_GCC)
24
24
template <class _Tp >
25
- struct __remove_cvref_gcc {
26
- using type = __remove_cvref(_Tp);
27
- };
28
-
29
- template <class _Tp >
30
- using __remove_cvref_t _LIBCPP_NODEBUG = typename __remove_cvref_gcc<_Tp>::type;
25
+ using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp);
31
26
#else
32
27
template <class _Tp >
33
- using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cvref( _Tp) ;
28
+ using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cv_t < __libcpp_remove_reference_t < _Tp> > ;
34
29
#endif // __has_builtin(__remove_cvref)
35
30
36
31
template <class _Tp , class _Up >
37
- using __is_same_uncvref = _IsSame<__remove_cvref_t <_Tp>, __remove_cvref_t <_Up> >;
32
+ struct __is_same_uncvref : _IsSame<__remove_cvref_t <_Tp>, __remove_cvref_t <_Up> > {} ;
38
33
39
34
#if _LIBCPP_STD_VER >= 20
40
35
template <class _Tp >
41
36
struct remove_cvref {
42
- using type _LIBCPP_NODEBUG = __remove_cvref( _Tp) ;
37
+ using type _LIBCPP_NODEBUG = __remove_cvref_t < _Tp> ;
43
38
};
44
39
45
40
template <class _Tp >
You can’t perform that action at this time.
0 commit comments