xref: /llvm-project/libcxx/test/std/ranges/range.adaptors/range.all/range.owning.view/implicit_ctad.pass.cpp (revision c2df70766647b39d302ab5ab952980e0b3b4d725)
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 
main(int,char **)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 }
32