codekingpro/portable-devtools
114k
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-exception6// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.7//8//===----------------------------------------------------------------------===//9 10#ifndef _LIBCUDACXX___TUPLE_APPLY_CV_H11#define _LIBCUDACXX___TUPLE_APPLY_CV_H12 13#ifndef __cuda_std__14# include <__config>15#endif // __cuda_std__16 17#include "../__type_traits/is_const.h"18#include "../__type_traits/is_reference.h"19#include "../__type_traits/is_volatile.h"20#include "../__type_traits/remove_reference.h"21 22#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)23# pragma GCC system_header24#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)25# pragma clang system_header26#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)27# pragma system_header28#endif // no system header29 30_LIBCUDACXX_BEGIN_NAMESPACE_STD31 32template <bool _ApplyLV, bool _ApplyConst, bool _ApplyVolatile>33struct __apply_cv_mf;34template <>35struct __apply_cv_mf<false, false, false>36{37 template <class _Tp>38 using __apply = _Tp;39};40template <>41struct __apply_cv_mf<false, true, false>42{43 template <class _Tp>44 using __apply _LIBCUDACXX_NODEBUG_TYPE = const _Tp;45};46template <>47struct __apply_cv_mf<false, false, true>48{49 template <class _Tp>50 using __apply _LIBCUDACXX_NODEBUG_TYPE = volatile _Tp;51};52template <>53struct __apply_cv_mf<false, true, true>54{55 template <class _Tp>56 using __apply _LIBCUDACXX_NODEBUG_TYPE = const volatile _Tp;57};58template <>59struct __apply_cv_mf<true, false, false>60{61 template <class _Tp>62 using __apply _LIBCUDACXX_NODEBUG_TYPE = _Tp&;63};64template <>65struct __apply_cv_mf<true, true, false>66{67 template <class _Tp>68 using __apply _LIBCUDACXX_NODEBUG_TYPE = const _Tp&;69};70template <>71struct __apply_cv_mf<true, false, true>72{73 template <class _Tp>74 using __apply _LIBCUDACXX_NODEBUG_TYPE = volatile _Tp&;75};76template <>77struct __apply_cv_mf<true, true, true>78{79 template <class _Tp>80 using __apply _LIBCUDACXX_NODEBUG_TYPE = const volatile _Tp&;81};82template <class _Tp, class _RawTp = __libcpp_remove_reference_t<_Tp> >83using __apply_cv_t _LIBCUDACXX_NODEBUG_TYPE =84 __apply_cv_mf<_LIBCUDACXX_TRAIT(is_lvalue_reference, _Tp),85 _LIBCUDACXX_TRAIT(is_const, _RawTp),86 _LIBCUDACXX_TRAIT(is_volatile, _RawTp)>;87 88_LIBCUDACXX_END_NAMESPACE_STD89 90#endif // _LIBCUDACXX___TUPLE_APPLY_CV_H91 