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 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
10 // UNSUPPORTED: libcpp-no-concepts
11 
12 // <filesystem>
13 
14 // template <>
15 // inline constexpr bool ranges::enable_view<filesystem::directory_iterator> = true;
16 // template <>
17 // inline constexpr bool ranges::enable_view<filesystem::recursive_directory_iterator> = true;
18 
19 #include <filesystem>
20 #include <ranges>
21 
22 template<class Range>
23 void test() {
24   static_assert(std::ranges::enable_view<Range>);
25   static_assert(!std::ranges::enable_view<Range&>);
26   static_assert(!std::ranges::enable_view<const Range>);
27 }
28 
29 void test() {
30   test<std::filesystem::directory_iterator>();
31   test<std::filesystem::recursive_directory_iterator>();
32 }
33