Skip to content

Commit

Permalink
Implement ranges::elements_view
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Apr 29, 2024
1 parent 86bee3e commit 2a0fed9
Show file tree
Hide file tree
Showing 30 changed files with 4,018 additions and 8 deletions.
16 changes: 8 additions & 8 deletions libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// 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.
// SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
// SPDX-FileCopyrightText: Copyright (c) 2023 Microsoft Corporation.
//
//===----------------------------------------------------------------------===//
Expand All @@ -24,15 +24,15 @@

#include <cuda/std/__iterator/concepts.h>

#if _CCCL_STD_VER > 2014
#if _CCCL_STD_VER >= 2017

_LIBCUDACXX_BEGIN_NAMESPACE_STD
_LIBCUDACXX_BEGIN_NAMESPACE_RANGES_ABI

// MSVC requires an interesting workaround for a /permissive- bug
// We cannot simply define unreachable_sentinel_t with it friendfunctions,
// but we must derive from a base class in a different namespace so that they
// are only ever found through ADL
// We cannot simply define unreachable_sentinel_t with its friend functions,
// but we must derive from a base class in a different namespace so that they are
// only ever found through ADL

struct unreachable_sentinel_t
# ifdef _CCCL_COMPILER_MSVC
Expand All @@ -49,7 +49,7 @@ struct __unreachable_base
{
return false;
}
# if _CCCL_STD_VER < 2020
# if _CCCL_STD_VER <= 2017
_LIBCUDACXX_TEMPLATE(class _Iter)
_LIBCUDACXX_REQUIRES(weakly_incrementable<_Iter>)
_LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_INLINE_VISIBILITY _CCCL_NODISCARD_FRIEND constexpr bool
Expand All @@ -71,7 +71,7 @@ struct __unreachable_base
{
return true;
}
# endif // _CCCL_STD_VER < 2020
# endif // _CCCL_STD_VER <= 2017
};

# ifdef _CCCL_COMPILER_MSVC
Expand All @@ -85,6 +85,6 @@ _LIBCUDACXX_END_NAMESPACE_RANGES_ABI
_LIBCUDACXX_CPO_ACCESSIBILITY unreachable_sentinel_t unreachable_sentinel{};
_LIBCUDACXX_END_NAMESPACE_STD

#endif // _CCCL_STD_VER > 2014
#endif // _CCCL_STD_VER >= 2017

#endif // _LIBCUDACXX___ITERATOR_UNREACHABLE_SENTINEL_H
Loading

0 comments on commit 2a0fed9

Please sign in to comment.