Debian Codegraph @

libcxx/test/std/ranges/range.adaptors/range.all/range.owning.view/implicit_ctad.pass.cpp

raw
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 // owning_view
12
13 // Make sure that the implicitly-generated CTAD works.
14
15 #include <ranges>
16 #include <utility>
17
18 #include "test_macros.h"
19
20 struct Range {
21 int* begin();
22 int* end();
23 };
24
25 int 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 }