brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1022 B · 6468d66 Raw
28 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// <span>12 13// template<class ElementType, size_t Extent>14// inline constexpr bool ranges::enable_borrowed_range<15//     span<ElementType, Extent>> = true;16 17#include <span>18 19#include "test_macros.h"20 21void test() {22  static_assert(std::ranges::enable_borrowed_range<std::span<int, 0> >);23  static_assert(std::ranges::enable_borrowed_range<std::span<int, 42> >);24  static_assert(std::ranges::enable_borrowed_range<std::span<int, std::dynamic_extent> >);25  static_assert(!std::ranges::enable_borrowed_range<std::span<int, 42>&>);26  static_assert(!std::ranges::enable_borrowed_range<std::span<int, 42> const>);27}28