Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
prev.h52 linesDownload Raw Back to __iterator
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___ITERATOR_PREV_H12#define _LIBCUDACXX___ITERATOR_PREV_H13 14#ifndef __cuda_std__15#include <__config>16#endif // __cuda_std__17 18#include "../__assert"19#include "../__iterator/advance.h"20#include "../__iterator/iterator_traits.h"21#include "../__type_traits/enable_if.h"22 23#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)24#  pragma GCC system_header25#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)26#  pragma clang system_header27#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)28#  pragma system_header29#endif // no system header30 31_LIBCUDACXX_BEGIN_NAMESPACE_STD32 33template <class _InputIter>34inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX1435__enable_if_t36<37    __is_cpp17_input_iterator<_InputIter>::value,38    _InputIter39>40prev(_InputIter __x,41     typename iterator_traits<_InputIter>::difference_type __n = 1)42{43    _LIBCUDACXX_ASSERT(__n <= 0 || __is_cpp17_bidirectional_iterator<_InputIter>::value,44                       "Attempt to prev(it, +n) on a non-bidi iterator");45    _CUDA_VSTD::advance(__x, -__n);46    return __x;47}48 49_LIBCUDACXX_END_NAMESPACE_STD50 51#endif // _LIBCUDACXX___ITERATOR_PREV_H52 
codekingpro/portable-devtools · Team Ai