chromium/third_party/libc++/src/include/__ranges/transform_view.h

// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP___RANGES_TRANSFORM_VIEW_H
#define _LIBCPP___RANGES_TRANSFORM_VIEW_H

#include <__compare/three_way_comparable.h>
#include <__concepts/constructible.h>
#include <__concepts/convertible_to.h>
#include <__concepts/copyable.h>
#include <__concepts/derived_from.h>
#include <__concepts/equality_comparable.h>
#include <__concepts/invocable.h>
#include <__config>
#include <__functional/bind_back.h>
#include <__functional/invoke.h>
#include <__functional/perfect_forward.h>
#include <__iterator/concepts.h>
#include <__iterator/iterator_traits.h>
#include <__memory/addressof.h>
#include <__ranges/access.h>
#include <__ranges/all.h>
#include <__ranges/concepts.h>
#include <__ranges/empty.h>
#include <__ranges/movable_box.h>
#include <__ranges/range_adaptor.h>
#include <__ranges/size.h>
#include <__ranges/view_interface.h>
#include <__type_traits/conditional.h>
#include <__type_traits/decay.h>
#include <__type_traits/is_nothrow_constructible.h>
#include <__type_traits/is_object.h>
#include <__type_traits/is_reference.h>
#include <__type_traits/maybe_const.h>
#include <__type_traits/remove_cvref.h>
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#  pragma GCC system_header
#endif

_LIBCPP_PUSH_MACROS
#include <__undef_macros>

_LIBCPP_BEGIN_NAMESPACE_STD

#if _LIBCPP_STD_VER >= 20

namespace ranges {

__regular_invocable_with_range_ref;

__transform_view_constraints;

#  if _LIBCPP_STD_VER >= 23
template <input_range _View, move_constructible _Fn>
#  else
template <input_range _View, copy_constructible _Fn>
#  endif
  requires __transform_view_constraints<_View, _Fn>
class _LIBCPP_ABI_LLVM18_NO_UNIQUE_ADDRESS transform_view : public view_interface<transform_view<_View, _Fn>> {};

template <class _Range, class _Fn>
transform_view(_Range&&, _Fn) -> transform_view<views::all_t<_Range>, _Fn>;

template <class _View>
struct __transform_view_iterator_concept {};

__transform_view_iterator_concept<_View>;

__transform_view_iterator_concept<_View>;

__transform_view_iterator_concept<_View>;

template <class, class>
struct __transform_view_iterator_category_base {};

__transform_view_iterator_category_base<_View, _Fn>;

#  if _LIBCPP_STD_VER >= 23
template <input_range _View, move_constructible _Fn>
#  else
template <input_range _View, copy_constructible _Fn>
#  endif
  requires __transform_view_constraints<_View, _Fn>
template <bool _Const>
class transform_view<_View, _Fn>::__iterator
    : public __transform_view_iterator_category_base<_View, __maybe_const<_Const, _Fn>> {};

#  if _LIBCPP_STD_VER >= 23
template <input_range _View, move_constructible _Fn>
#  else
template <input_range _View, copy_constructible _Fn>
#  endif
  requires __transform_view_constraints<_View, _Fn>
template <bool _Const>
class transform_view<_View, _Fn>::__sentinel {};

namespace views {
namespace __transform {
struct __fn {};
} // namespace __transform

inline namespace __cpo {
inline constexpr auto transform =;
} // namespace __cpo
} // namespace views

} // namespace ranges

#endif // _LIBCPP_STD_VER >= 20

_LIBCPP_END_NAMESPACE_STD

_LIBCPP_POP_MACROS

#endif // _LIBCPP___RANGES_TRANSFORM_VIEW_H