Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:40

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP___CXX03___RANGES_ENABLE_VIEW_H
0011 #define _LIBCPP___CXX03___RANGES_ENABLE_VIEW_H
0012 
0013 #include <__cxx03/__concepts/derived_from.h>
0014 #include <__cxx03/__concepts/same_as.h>
0015 #include <__cxx03/__config>
0016 #include <__cxx03/__type_traits/is_class.h>
0017 #include <__cxx03/__type_traits/is_convertible.h>
0018 #include <__cxx03/__type_traits/remove_cv.h>
0019 
0020 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0021 #  pragma GCC system_header
0022 #endif
0023 
0024 _LIBCPP_BEGIN_NAMESPACE_STD
0025 
0026 #if _LIBCPP_STD_VER >= 20
0027 
0028 namespace ranges {
0029 
0030 struct view_base {};
0031 
0032 template <class _Derived>
0033   requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>>
0034 class view_interface;
0035 
0036 template <class _Op, class _Yp>
0037   requires is_convertible_v<_Op*, view_interface<_Yp>*>
0038 void __is_derived_from_view_interface(const _Op*, const view_interface<_Yp>*);
0039 
0040 template <class _Tp>
0041 inline constexpr bool enable_view = derived_from<_Tp, view_base> || requires {
0042   ranges::__is_derived_from_view_interface((_Tp*)nullptr, (_Tp*)nullptr);
0043 };
0044 
0045 } // namespace ranges
0046 
0047 #endif // _LIBCPP_STD_VER >= 20
0048 
0049 _LIBCPP_END_NAMESPACE_STD
0050 
0051 #endif // _LIBCPP___CXX03___RANGES_ENABLE_VIEW_H