Path: blob/main/contrib/llvm-project/libcxx/include/__ranges/enable_view.h
35236 views
// -*- C++ -*-1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//89#ifndef _LIBCPP___RANGES_ENABLE_VIEW_H10#define _LIBCPP___RANGES_ENABLE_VIEW_H1112#include <__concepts/derived_from.h>13#include <__concepts/same_as.h>14#include <__config>15#include <__type_traits/is_class.h>16#include <__type_traits/is_convertible.h>17#include <__type_traits/remove_cv.h>1819#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)20# pragma GCC system_header21#endif2223_LIBCPP_BEGIN_NAMESPACE_STD2425#if _LIBCPP_STD_VER >= 202627namespace ranges {2829struct view_base {};3031template <class _Derived>32requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>>33class view_interface;3435template <class _Op, class _Yp>36requires is_convertible_v<_Op*, view_interface<_Yp>*>37void __is_derived_from_view_interface(const _Op*, const view_interface<_Yp>*);3839template <class _Tp>40inline constexpr bool enable_view = derived_from<_Tp, view_base> || requires {41ranges::__is_derived_from_view_interface((_Tp*)nullptr, (_Tp*)nullptr);42};4344} // namespace ranges4546#endif // _LIBCPP_STD_VER >= 204748_LIBCPP_END_NAMESPACE_STD4950#endif // _LIBCPP___RANGES_ENABLE_VIEW_H515253