Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / ranges / range.factories / range.iota.view / begin.pass.cpp
blob06419c1b14ee03779a93a164a10b1221e40d3141
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 // constexpr iterator begin() const;
13 #include <cassert>
14 #include <ranges>
15 #include <utility>
17 #include "test_macros.h"
18 #include "types.h"
20 template<class T>
21 constexpr void testType() {
23 std::ranges::iota_view<T> io(T(0));
24 assert(*io.begin() == T(0));
27 std::ranges::iota_view<T> io(T(10));
28 assert(*io.begin() == T(10));
29 assert(*std::move(io).begin() == T(10));
32 const std::ranges::iota_view<T> io(T(0));
33 assert(*io.begin() == T(0));
36 const std::ranges::iota_view<T> io(T(10));
37 assert(*io.begin() == T(10));
41 constexpr bool test() {
42 testType<SomeInt>();
43 testType<long long>();
44 testType<unsigned long long>();
45 testType<signed long>();
46 testType<unsigned long>();
47 testType<int>();
48 testType<unsigned>();
49 testType<short>();
50 testType<unsigned short>();
52 return true;
55 int main(int, char**) {
56 test();
57 static_assert(test());
59 return 0;