| 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 |
// template<class T> |
| 12 |
// single_view(T) -> single_view<T>; |
| 13 |
|
| 14 |
#include <ranges> |
| 15 |
|
| 16 |
#include <cassert> |
| 17 |
#include <concepts> |
| 18 |
|
| 19 |
#include "test_iterators.h" |
| 20 |
|
| 21 |
struct Empty {}; |
| 22 |
|
| 23 |
static_assert(std::same_as< |
| 24 |
decltype(std::ranges::single_view(Empty())), |
| 25 |
std::ranges::single_view<Empty> |
| 26 |
>); |
| 27 |
|
| 28 |
static_assert(std::same_as< |
| 29 |
decltype(std::ranges::single_view(std::declval<Empty&>())), |
| 30 |
std::ranges::single_view<Empty> |
| 31 |
>); |
| 32 |
|
| 33 |
static_assert(std::same_as< |
| 34 |
decltype(std::ranges::single_view(std::declval<Empty&&>())), |
| 35 |
std::ranges::single_view<Empty> |
| 36 |
>); |