Revert "[libc] Use best-fit binary trie to make malloc logarithmic" (#117065)
[llvm-project.git] / libcxx / test / std / ranges / range.factories / range.iota.view / range_concept_conformance.compile.pass.cpp
blob1922139e32cbe01c939e7e22c0a4918a1ab517bf
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 // Test that iota_view conforms to range and view concepts.
13 #include <ranges>
15 #include "types.h"
17 struct Decrementable {
18 using difference_type = int;
20 auto operator<=>(const Decrementable&) const = default;
22 Decrementable& operator++();
23 Decrementable operator++(int);
24 Decrementable& operator--();
25 Decrementable operator--(int);
28 struct Incrementable {
29 using difference_type = int;
31 auto operator<=>(const Incrementable&) const = default;
33 Incrementable& operator++();
34 Incrementable operator++(int);
37 static_assert(std::ranges::random_access_range<std::ranges::iota_view<int>>);
38 static_assert(std::ranges::random_access_range<const std::ranges::iota_view<int>>);
39 static_assert(std::ranges::bidirectional_range<std::ranges::iota_view<Decrementable>>);
40 static_assert(std::ranges::forward_range<std::ranges::iota_view<Incrementable>>);
41 static_assert(std::ranges::input_range<std::ranges::iota_view<NotIncrementable>>);
42 static_assert(std::ranges::view<std::ranges::iota_view<int>>);