//===----------------------------------------------------------------------===// // // 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) 2024 NVIDIA CORPORATION & AFFILIATES. // //===----------------------------------------------------------------------===// // UNSUPPORTED: msvc-19.16 // class cuda::std::ranges::subrange; #include #include #include "test_iterators.h" #include "test_macros.h" using FI = forward_iterator; TEST_GLOBAL_VARIABLE FI fi{nullptr}; TEST_GLOBAL_VARIABLE int* ptr = nullptr; static_assert(cuda::std::same_as>); static_assert(cuda::std::same_as>); static_assert( cuda::std::same_as>); struct ForwardRange { __host__ __device__ forward_iterator begin() const; __host__ __device__ forward_iterator end() const; }; template <> inline constexpr bool cuda::std::ranges::enable_borrowed_range = true; struct SizedRange { __host__ __device__ int* begin(); __host__ __device__ int* end(); }; template <> inline constexpr bool cuda::std::ranges::enable_borrowed_range = true; static_assert(cuda::std::same_as>); static_assert(cuda::std::same_as>); static_assert(cuda::std::same_as>); int main(int, char**) { unused(fi); unused(ptr); return 0; }