1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
11 // template<class... Args>
12 // requires constructible_from<T, Args...>
13 // constexpr explicit single_view(in_place_t, Args&&... args);
19 #include "test_macros.h"
23 constexpr TakesTwoInts(int a
, int b
) : a_(a
), b_(b
) {}
26 constexpr bool test() {
28 std::ranges::single_view
<TakesTwoInts
> sv(std::in_place
, 1, 2);
29 assert(sv
.data()->a_
== 1);
30 assert(sv
.data()->b_
== 2);
31 assert(sv
.size() == 1);
34 const std::ranges::single_view
<TakesTwoInts
> sv(std::in_place
, 1, 2);
35 assert(sv
.data()->a_
== 1);
36 assert(sv
.data()->b_
== 2);
37 assert(sv
.size() == 1);
43 int main(int, char**) {
45 static_assert(test());