Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / ranges / range.factories / range.single.view / assign.pass.cpp
blob4fe08c957a427a03896980adb1415a881b2207b6
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 // Tests that <value_> is a <copyable-box>.
13 #include <cassert>
14 #include <ranges>
15 #include <utility>
17 #include "test_macros.h"
19 struct NotAssignable {
20 NotAssignable() = default;
21 NotAssignable(const NotAssignable&) = default;
22 NotAssignable(NotAssignable&&) = default;
24 NotAssignable& operator=(const NotAssignable&) = delete;
25 NotAssignable& operator=(NotAssignable&&) = delete;
28 constexpr bool test() {
29 const std::ranges::single_view<NotAssignable> a;
30 std::ranges::single_view<NotAssignable> b;
31 b = a;
32 b = std::move(a);
34 return true;
37 int main(int, char**) {
38 test();
39 static_assert(test());
41 return 0;