Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
predicate.h57 linesDownload Raw Back to __concepts
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___CONCEPTS_PREDICATE_H11#define _LIBCUDACXX___CONCEPTS_PREDICATE_H12 13#ifndef __cuda_std__14#include <__config>15#endif //__cuda_std__16 17#include "../__concepts/__concept_macros.h"18#include "../__concepts/boolean_testable.h"19#include "../__concepts/invocable.h"20#include "../__functional/invoke.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 32#if _LIBCUDACXX_STD_VER > 1733 34template<class _Fn, class... _Args>35concept predicate =36  regular_invocable<_Fn, _Args...> && __boolean_testable<invoke_result_t<_Fn, _Args...>>;37 38#elif _LIBCUDACXX_STD_VER > 1139 40// [concept.predicate]41template<class _Fn, class... _Args>42_LIBCUDACXX_CONCEPT_FRAGMENT(43  _Predicate_,44  requires()(//45    requires(regular_invocable<_Fn, _Args...>),46    requires(__boolean_testable<invoke_result_t<_Fn, _Args...>>)47  ));48 49template<class _Fn, class... _Args>50_LIBCUDACXX_CONCEPT predicate = _LIBCUDACXX_FRAGMENT(_Predicate_, _Fn, _Args...);51 52#endif // _LIBCUDACXX_STD_VER > 1153 54_LIBCUDACXX_END_NAMESPACE_STD55 56#endif // _LIBCUDACXX___CONCEPTS_PREDICATE_H57