32 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++1710 11// owning_view12 13// Make sure that the implicitly-generated CTAD works.14 15#include <ranges>16#include <utility>17 18#include "test_macros.h"19 20struct Range {21 int* begin();22 int* end();23};24 25int main(int, char**) {26 Range r;27 std::ranges::owning_view view{std::move(r)};28 ASSERT_SAME_TYPE(decltype(view), std::ranges::owning_view<Range>);29 30 return 0;31}32