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, c++20
10 // UNSUPPORTED: libcpp-has-no-incomplete-ranges
11 
12 // template <class... Rs>
13 // zip_view(Rs&&...) -> zip_view<views::all_t<Rs>...>;
14 
15 #include <cassert>
16 #include <ranges>
17 #include <utility>
18 
19 struct Container {
20   int* begin() const;
21   int* end() const;
22 };
23 
24 struct View : std::ranges::view_base {
25   int* begin() const;
26   int* end() const;
27 };
28 
testCTAD()29 void testCTAD() {
30   static_assert(std::is_same_v<decltype(std::ranges::zip_view(Container{})),
31                                std::ranges::zip_view<std::ranges::owning_view<Container>>>);
32 
33   static_assert(std::is_same_v<decltype(std::ranges::zip_view(Container{}, View{})),
34                                std::ranges::zip_view<std::ranges::owning_view<Container>, View>>);
35 
36   Container c{};
37   static_assert(std::is_same_v<
38                 decltype(std::ranges::zip_view(Container{}, View{}, c)),
39                 std::ranges::zip_view<std::ranges::owning_view<Container>, View, std::ranges::ref_view<Container>>>);
40 }
41