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