[mlir][acc] Introduce MappableType interface (#122146)
[llvm-project.git] / libcxx / test / std / input.output / filesystems / fs.filesystem.synopsis / enable_borrowed_range.compile.pass.cpp
blobc73eebf7e0a72a937095759ce306992266fd8546
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
10 // UNSUPPORTED: no-filesystem
11 // UNSUPPORTED: availability-filesystem-missing
13 // <filesystem>
15 // template <>
16 // inline constexpr bool ranges::enable_borrowed_range<filesystem::directory_iterator> = true;
17 // template <>
18 // inline constexpr bool ranges::enable_borrowed_range<filesystem::recursive_directory_iterator> = true;
20 #include <filesystem>
21 #include <ranges>
23 template<class Range>
24 void test() {
25 static_assert(std::ranges::enable_borrowed_range<Range>);
26 static_assert(!std::ranges::enable_borrowed_range<Range&>);
27 static_assert(!std::ranges::enable_borrowed_range<const Range>);
30 void test() {
31 test<std::filesystem::directory_iterator>();
32 test<std::filesystem::recursive_directory_iterator>();