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_COPY_CV_H
10#define _LIBCPP___TYPE_TRAITS_COPY_CV_H
11
12#include <__config>
13
14#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15# pragma GCC system_header
16#endif
17
18_LIBCPP_BEGIN_NAMESPACE_STD
19
20// Let COPYCV(FROM, TO) be an alias for type TO with the addition of FROM's
21// top-level cv-qualifiers.
22template <class _From>
23struct __copy_cv {
24 template <class _To>
25 using __apply _LIBCPP_NODEBUG = _To;
26};
27
28template <class _From>
29struct __copy_cv<const _From> {
30 template <class _To>
31 using __apply _LIBCPP_NODEBUG = const _To;
32};
33
34template <class _From>
35struct __copy_cv<volatile _From> {
36 template <class _To>
37 using __apply _LIBCPP_NODEBUG = volatile _To;
38};
39
40template <class _From>
41struct __copy_cv<const volatile _From> {
42 template <class _To>
43 using __apply _LIBCPP_NODEBUG = const volatile _To;
44};
45
46template <class _From, class _To>
47using __copy_cv_t _LIBCPP_NODEBUG = typename __copy_cv<_From>::template __apply<_To>;
48
49_LIBCPP_END_NAMESPACE_STD
50
51#endif // _LIBCPP___TYPE_TRAITS_COPY_CV_H
52

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

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