Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
pointer_to_unary_function.h59 linesDownload Raw Back to __functional
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___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H12#define _LIBCUDACXX___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H13 14#ifndef __cuda_std__15#include <__config>16#endif // __cuda_std__17 18#include "../__functional/unary_function.h"19 20#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)21#  pragma GCC system_header22#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)23#  pragma clang system_header24#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)25#  pragma system_header26#endif // no system header27 28_LIBCUDACXX_BEGIN_NAMESPACE_STD29 30#if _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS)31 32_CCCL_DIAG_SUPPRESS_DEPRECATED_PUSH33 34template <class _Arg, class _Result>35class _LIBCUDACXX_TEMPLATE_VIS _LIBCUDACXX_DEPRECATED_IN_CXX11 pointer_to_unary_function36    : public __unary_function<_Arg, _Result>37{38    _Result (*__f_)(_Arg);39public:40    _LIBCUDACXX_INLINE_VISIBILITY explicit pointer_to_unary_function(_Result (*__f)(_Arg))41        : __f_(__f) {}42    _LIBCUDACXX_INLINE_VISIBILITY _Result operator()(_Arg __x) const43        {return __f_(__x);}44};45 46template <class _Arg, class _Result>47_LIBCUDACXX_DEPRECATED_IN_CXX11 inline _LIBCUDACXX_INLINE_VISIBILITY48pointer_to_unary_function<_Arg,_Result>49ptr_fun(_Result (*__f)(_Arg))50    {return pointer_to_unary_function<_Arg,_Result>(__f);}51 52_CCCL_DIAG_SUPPRESS_DEPRECATED_POP53 54#endif // _LIBCUDACXX_STD_VER <= 14 || defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS)55 56_LIBCUDACXX_END_NAMESPACE_STD57 58#endif // _LIBCUDACXX___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H59 
codekingpro/portable-devtools · Team Ai