| // -*- C++ -*- | |
| //===----------------------------------------------------------------------===// | |
| // | |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| // See https://llvm.org/LICENSE.txt for license information. | |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. | |
| // | |
| //===----------------------------------------------------------------------===// | |
| _LIBCUDACXX_BEGIN_NAMESPACE_STD | |
| template <class _Tp> | |
| _LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY constexpr _Tp&& | |
| forward(__libcpp_remove_reference_t<_Tp>& __t) noexcept { | |
| return static_cast<_Tp&&>(__t); | |
| } | |
| template <class _Tp> | |
| _LIBCUDACXX_NODISCARD_EXT inline _LIBCUDACXX_INLINE_VISIBILITY constexpr _Tp&& | |
| forward(__libcpp_remove_reference_t<_Tp>&& __t) noexcept { | |
| static_assert(!is_lvalue_reference<_Tp>::value, "cannot forward an rvalue as an lvalue"); | |
| return static_cast<_Tp&&>(__t); | |
| } | |
| _LIBCUDACXX_END_NAMESPACE_STD | |