Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / ranges / range.factories / range.iota.view / iterator / ctor.value.pass.cpp
bloba84cb91f7e9b35a2b320b8122ebb314fa3a32b8f
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 explicit iterator(W value);
13 #include <cassert>
14 #include <ranges>
15 #include <type_traits>
17 #include "test_macros.h"
18 #include "../types.h"
20 constexpr bool test() {
22 using Iter = std::ranges::iterator_t<std::ranges::iota_view<int>>;
23 auto iter = Iter(42);
24 assert(*iter == 42);
27 using Iter = std::ranges::iterator_t<std::ranges::iota_view<SomeInt>>;
28 auto iter = Iter(SomeInt(42));
29 assert(*iter == SomeInt(42));
32 using Iter = std::ranges::iterator_t<std::ranges::iota_view<SomeInt>>;
33 static_assert(!std::is_convertible_v<Iter, SomeInt>);
34 static_assert( std::is_constructible_v<Iter, SomeInt>);
37 return true;
40 int main(int, char**) {
41 test();
42 static_assert(test());
44 return 0;