xref: /freebsd/contrib/llvm-project/libcxx/include/__type_traits/remove_cv.h (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
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_REMOVE_CV_H
10 #define _LIBCPP___TYPE_TRAITS_REMOVE_CV_H
11 
12 #include <__config>
13 #include <__type_traits/remove_const.h>
14 #include <__type_traits/remove_volatile.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 
22 #if __has_builtin(__remove_cv) && !defined(_LIBCPP_COMPILER_GCC)
23 template <class _Tp>
24 struct remove_cv {
25   using type _LIBCPP_NODEBUG = __remove_cv(_Tp);
26 };
27 
28 template <class _Tp>
29 using __remove_cv_t = __remove_cv(_Tp);
30 #else
31 template <class _Tp>
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)
39 
40 #if _LIBCPP_STD_VER >= 14
41 template <class _Tp>
42 using remove_cv_t = __remove_cv_t<_Tp>;
43 #endif
44 
45 _LIBCPP_END_NAMESPACE_STD
46 
47 #endif // _LIBCPP___TYPE_TRAITS_REMOVE_CV_H
48