Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
back_insert_iterator.h72 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_BACK_INSERT_ITERATOR_H12#define _LIBCUDACXX___ITERATOR_BACK_INSERT_ITERATOR_H13 14#ifndef __cuda_std__15#include <__config>16#endif // __cuda_std__17 18#include "../__iterator/iterator.h"19#include "../__iterator/iterator_traits.h"20#include "../__memory/addressof.h"21#include "../__utility/move.h"22#include "../cstddef"23 24#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)25#  pragma GCC system_header26#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)27#  pragma clang system_header28#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)29#  pragma system_header30#endif // no system header31 32_LIBCUDACXX_BEGIN_NAMESPACE_STD33 34_LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH35template <class _Container>36class _LIBCUDACXX_TEMPLATE_VIS back_insert_iterator37#if _LIBCUDACXX_STD_VER <= 14 || !defined(_LIBCUDACXX_ABI_NO_ITERATOR_BASES)38    : public iterator<output_iterator_tag,39                      void,40                      void,41                      void,42                      void>43#endif44{45_LIBCUDACXX_SUPPRESS_DEPRECATED_POP46protected:47    _Container* container;48public:49    typedef _Container container_type;50 51    _LIBCUDACXX_INLINE_VISIBILITY explicit back_insert_iterator(_Container& __x) : container(_CUDA_VSTD::addressof(__x)) {}52    _LIBCUDACXX_INLINE_VISIBILITY back_insert_iterator& operator=(const typename _Container::value_type& __value_)53        {container->push_back(__value_); return *this;}54    _LIBCUDACXX_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::value_type&& __value_)55        {container->push_back(_CUDA_VSTD::move(__value_)); return *this;}56    _LIBCUDACXX_INLINE_VISIBILITY back_insert_iterator& operator*()     {return *this;}57    _LIBCUDACXX_INLINE_VISIBILITY back_insert_iterator& operator++()    {return *this;}58    _LIBCUDACXX_INLINE_VISIBILITY back_insert_iterator  operator++(int) {return *this;}59};60 61template <class _Container>62inline _LIBCUDACXX_INLINE_VISIBILITY63back_insert_iterator<_Container>64back_inserter(_Container& __x)65{66    return back_insert_iterator<_Container>(__x);67}68 69_LIBCUDACXX_END_NAMESPACE_STD70 71#endif // _LIBCUDACXX___ITERATOR_BACK_INSERT_ITERATOR_H72 
codekingpro/portable-devtools · Team Ai