| 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 | // explicit std::ranges::lazy_split_view::outer-iterator::outer-iterator(Parent& parent) |
| 12 | // requires (!forward_range<Base>) |
| 13 | |
| 14 | #include <ranges> |
| 15 | |
| 16 | #include <type_traits> |
| 17 | #include <utility> |
| 18 | #include "../types.h" |
| 19 | |
| 20 | // Verify that the constructor is `explicit`. |
| 21 | static_assert(!std::is_convertible_v<SplitViewInput&, OuterIterInput>); |
| 22 | |
| 23 | static_assert( std::ranges::forward_range<SplitViewForward>); |
| 24 | static_assert(!std::is_constructible_v<OuterIterForward, SplitViewForward&>); |
| 25 | |
| 26 | constexpr bool test() { |
| 27 | InputView input; |
| 28 | SplitViewInput v(input, ForwardTinyView()); |
| 29 | [[maybe_unused]] OuterIterInput i(v); |
| 30 | |
| 31 | return true; |
| 32 | } |
| 33 | |
| 34 | int main(int, char**) { |
| 35 | test(); |
| 36 | static_assert(test()); |
| 37 | |
| 38 | return 0; |
| 39 | } |
| 40 | |