//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 // ranges::next(it) #include #include #include #include #include "test_iterators.h" template constexpr void check(int* first, int* expected) { It it(first); std::same_as auto result = std::ranges::next(std::move(it)); assert(base(result) == expected); } constexpr bool test() { int range[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; for (int n = 0; n != 9; ++n) { check>( range+n, range+n+1); check>( range+n, range+n+1); check>( range+n, range+n+1); check>(range+n, range+n+1); check>(range+n, range+n+1); check>( range+n, range+n+1); check>( range+n, range+n+1); check( range+n, range+n+1); } return true; } int main(int, char**) { test(); static_assert(test()); return 0; }