2 //===----------------------------------------------------------------------===//
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-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___RANGES_ENABLE_VIEW_H
11 #define _LIBCPP___RANGES_ENABLE_VIEW_H
15 #include <type_traits>
17 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18 #pragma GCC system_header
21 _LIBCPP_BEGIN_NAMESPACE_STD
23 #if !defined(_LIBCPP_HAS_NO_RANGES)
29 template<class _Derived>
30 requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>>
33 template<class _Op, class _Yp>
34 requires is_convertible_v<_Op*, view_interface<_Yp>*>
35 void __is_derived_from_view_interface(const _Op*, const view_interface<_Yp>*);
38 inline constexpr bool enable_view = derived_from<_Tp, view_base> ||
39 requires { ranges::__is_derived_from_view_interface((_Tp*)nullptr, (_Tp*)nullptr); };
41 } // end namespace ranges
43 #endif // !_LIBCPP_HAS_NO_RANGES
45 _LIBCPP_END_NAMESPACE_STD
47 #endif // _LIBCPP___RANGES_ENABLE_VIEW_H