brintos

brintos / llvm-project-archived public Read only

0
0
Text · 917 B · 9383fd4 Raw
33 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++14, c++1710 11// sentinel() = default;12 13#include <ranges>14#include <cassert>15 16#include "test_macros.h"17#include "../types.h"18 19constexpr bool test() {20  using Sent = std::ranges::sentinel_t<std::ranges::iota_view<Int42<DefaultTo42>, IntComparableWith<Int42<DefaultTo42>>>>;21  using Iter = std::ranges::iterator_t<std::ranges::iota_view<Int42<DefaultTo42>, IntComparableWith<Int42<DefaultTo42>>>>;22  assert(Sent() == Iter());23 24  return true;25}26 27int main(int, char**) {28  test();29  static_assert(test());30 31  return 0;32}33