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 // template<class T> 12 // concept range; 13 14 #include <ranges> 15 16 #include <vector> 17 18 #include "test_range.h" 19 20 21 22 static_assert(std::ranges::range<test_range<cpp20_input_iterator> >); 23 24 struct incompatible_iterators { 25 int* begin(); 26 long* end(); 27 }; 28 static_assert(!std::ranges::range<incompatible_iterators>); 29 30 struct int_begin_int_end { 31 int begin(); 32 int end(); 33 }; 34 static_assert(!std::ranges::range<int_begin_int_end>); 35 36 struct iterator_begin_int_end { 37 int* begin(); 38 int end(); 39 }; 40 static_assert(!std::ranges::range<iterator_begin_int_end>); 41 42 struct int_begin_iterator_end { 43 int begin(); 44 int* end(); 45 }; 46 static_assert(!std::ranges::range<int_begin_iterator_end>); 47 48 // Test ADL-proofing. 49 struct Incomplete; 50 template<class T> struct Holder { T t; }; 51 static_assert(!std::ranges::range<Holder<Incomplete>*>); 52