43 lines · c
1// -*- C++ -*-2//===----------------------------------------------------------------------===//3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef _LIBCPP___RANGES_DANGLING_H11#define _LIBCPP___RANGES_DANGLING_H12 13#include <__config>14#include <__ranges/access.h>15#include <__ranges/concepts.h>16#include <__type_traits/conditional.h>17 18#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)19# pragma GCC system_header20#endif21 22_LIBCPP_BEGIN_NAMESPACE_STD23 24#if _LIBCPP_STD_VER >= 2025 26namespace ranges {27struct dangling {28 dangling() = default;29 _LIBCPP_HIDE_FROM_ABI constexpr dangling(auto&&...) noexcept {}30};31 32template <range _Rp>33using borrowed_iterator_t = _If<borrowed_range<_Rp>, iterator_t<_Rp>, dangling>;34 35// borrowed_subrange_t defined in <__ranges/subrange.h>36} // namespace ranges37 38#endif // _LIBCPP_STD_VER >= 2039 40_LIBCPP_END_NAMESPACE_STD41 42#endif // _LIBCPP___RANGES_DANGLING_H43