Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / ranges / range.factories / range.single.view / ctor.in_place.pass.cpp
blobcaaf137a97b01222f10c89d3c1336bff1f3991ff
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 //===----------------------------------------------------------------------===//
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);
15 #include <cassert>
16 #include <ranges>
17 #include <utility>
19 #include "test_macros.h"
21 struct TakesTwoInts {
22 int a_, b_;
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);
40 return true;
43 int main(int, char**) {
44 test();
45 static_assert(test());
47 return 0;