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