Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
forward.h48 linesDownload Raw Back to __utility
1// -*- C++ -*-2//===----------------------------------------------------------------------===//3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.8//9//===----------------------------------------------------------------------===//10 11#ifndef _LIBCUDACXX___UTILITY_FORWARD_H12#define _LIBCUDACXX___UTILITY_FORWARD_H13 14#ifndef __cuda_std__15#include <__config>16#endif // __cuda_std__17 18#include "../__type_traits/is_reference.h"19#include "../__type_traits/remove_reference.h"20#include "../cstddef"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 <class _Tp>33_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY constexpr _Tp&&34forward(__libcpp_remove_reference_t<_Tp>& __t) noexcept {35  return static_cast<_Tp&&>(__t);36}37 38template <class _Tp>39_LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY constexpr _Tp&&40forward(__libcpp_remove_reference_t<_Tp>&& __t) noexcept {41  static_assert(!is_lvalue_reference<_Tp>::value, "cannot forward an rvalue as an lvalue");42  return static_cast<_Tp&&>(__t);43}44 45_LIBCUDACXX_END_NAMESPACE_STD46 47#endif // _LIBCUDACXX___UTILITY_FORWARD_H48 
codekingpro/portable-devtools · Team Ai