Fix macho-merged-funcs-dwarf.yaml test on Windows
[llvm-project.git] / libcxx / include / __cxx03 / __ranges / enable_view.h
blobb8d78c29064b7a9814e15eb6532017051d71bb3c
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-exception
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___CXX03___RANGES_ENABLE_VIEW_H
11 #define _LIBCPP___CXX03___RANGES_ENABLE_VIEW_H
13 #include <__cxx03/__concepts/derived_from.h>
14 #include <__cxx03/__concepts/same_as.h>
15 #include <__cxx03/__config>
16 #include <__cxx03/__type_traits/is_class.h>
17 #include <__cxx03/__type_traits/is_convertible.h>
18 #include <__cxx03/__type_traits/remove_cv.h>
20 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
21 # pragma GCC system_header
22 #endif
24 _LIBCPP_BEGIN_NAMESPACE_STD
26 #if _LIBCPP_STD_VER >= 20
28 namespace ranges {
30 struct view_base {};
32 template <class _Derived>
33 requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>>
34 class view_interface;
36 template <class _Op, class _Yp>
37 requires is_convertible_v<_Op*, view_interface<_Yp>*>
38 void __is_derived_from_view_interface(const _Op*, const view_interface<_Yp>*);
40 template <class _Tp>
41 inline constexpr bool enable_view = derived_from<_Tp, view_base> || requires {
42 ranges::__is_derived_from_view_interface((_Tp*)nullptr, (_Tp*)nullptr);
45 } // namespace ranges
47 #endif // _LIBCPP_STD_VER >= 20
49 _LIBCPP_END_NAMESPACE_STD
51 #endif // _LIBCPP___CXX03___RANGES_ENABLE_VIEW_H