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 //===----------------------------------------------------------------------===//
9 
10 #ifndef _LIBCPP___RANGES_VIEW_H
11 #define _LIBCPP___RANGES_VIEW_H
12 
13 #include <__config>
14 #include <__ranges/concepts.h>
15 #include <concepts>
16 
17 
18 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19 #pragma GCC system_header
20 #endif
21 
22 _LIBCPP_PUSH_MACROS
23 #include <__undef_macros>
24 
25 _LIBCPP_BEGIN_NAMESPACE_STD
26 
27 #if !defined(_LIBCPP_HAS_NO_RANGES)
28 
29 namespace ranges {
30 
31 struct view_base { };
32 
33 template <class _Tp>
34 inline constexpr bool enable_view = derived_from<_Tp, view_base>;
35 
36 template <class _Tp>
37 concept view =
38   range<_Tp> &&
39   movable<_Tp> &&
40   default_initializable<_Tp> &&
41   enable_view<_Tp>;
42 
43 } // end namespace ranges
44 
45 #endif // !_LIBCPP_HAS_NO_RANGES
46 
47 _LIBCPP_END_NAMESPACE_STD
48 
49 _LIBCPP_POP_MACROS
50 
51 #endif // _LIBCPP___RANGES_VIEW_H
52