42 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++17, c++2010 11// template<class F, class... Rs>12// zip_transform_view(F, Rs&&...) -> zip_transform_view<F, views::all_t<Rs>...>;13 14#include <cassert>15#include <ranges>16 17#include "types.h"18 19struct Container {20 int* begin() const;21 int* end() const;22};23 24struct Fn {25 int operator()(auto&&...) const { return 5; }26};27 28void testCTAD() {29 static_assert(std::is_same_v<decltype(std::ranges::zip_transform_view(Fn{}, Container{})),30 std::ranges::zip_transform_view<Fn, std::ranges::owning_view<Container>>>);31 32 static_assert(std::is_same_v<decltype(std::ranges::zip_transform_view(Fn{}, Container{}, IntView{})),33 std::ranges::zip_transform_view<Fn, std::ranges::owning_view<Container>, IntView>>);34 35 Container c{};36 static_assert(37 std::is_same_v<38 decltype(std::ranges::zip_transform_view(Fn{}, Container{}, IntView{}, c)),39 std::ranges::40 zip_transform_view<Fn, std::ranges::owning_view<Container>, IntView, std::ranges::ref_view<Container>>>);41}42