Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / utilities / any / any.class / any.modifiers / reset.pass.cpp
blob6b52036a6e716b3093a66df3d226aa38e60c5f77
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
11 // <any>
13 // any::reset() noexcept
15 #include <any>
16 #include <cassert>
18 #include "test_macros.h"
19 #include "any_helpers.h"
21 int main(int, char**)
23 // empty
25 std::any a;
26 ASSERT_NOEXCEPT(a.reset());
28 assertEmpty(a);
30 a.reset();
32 assertEmpty(a);
34 // small object
36 std::any a = small(1);
37 assert(small::count == 1);
38 assertContains<small>(a, 1);
40 a.reset();
42 assertEmpty<small>(a);
43 assert(small::count == 0);
45 // large object
47 std::any a = large(1);
48 assert(large::count == 1);
49 assertContains<large>(a, 1);
51 a.reset();
53 assertEmpty<large>(a);
54 assert(large::count == 0);
57 return 0;