//===----------------------------------------------------------------------===// // // 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 // template // lazy_split_view(R&&, P&&) -> lazy_split_view, views::all_t

>; // // template // lazy_split_view(R&&, range_value_t) -> lazy_split_view, single_view>>; #include #include #include #include #include "types.h" struct ForwardRange { forward_iterator begin() const; forward_iterator end() const; }; static_assert( std::ranges::forward_range); struct InputRange { cpp20_input_iterator begin() const; sentinel_wrapper> end() const; }; static_assert(std::ranges::input_range); template constexpr void test() { I1 i1{}; I2 i2{}; std::ranges::lazy_split_view v(std::move(i1), std::move(i2)); static_assert(std::same_as>); using O = decltype(std::move(v).base()); static_assert(std::same_as); } constexpr void testCtad() { // (Range, Pattern) test(); test, std::ranges::views::all_t>(); // (Range, RangeElement) test, std::ranges::single_view>(); test, std::ranges::single_view>(); // (Range, RangeElement) with implicit conversion. test, std::ranges::single_view>(); test, std::ranges::single_view>(); // Note: CTAD from (InputRange, ForwardTinyRange) doesn't work -- the deduction guide wraps the pattern in // `views::all_t`, resulting in `views::owning_view`. That type would never satisfy `tiny-range` // because `views::owning_view` contains a member function `size()` that shadows the static `size()` in // `ForwardTinyRange`. }