File indexing completed on 2026-05-03 08:13:10
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef _LIBCPP___ALGORITHM_RANGES_MOVE_H
0010 #define _LIBCPP___ALGORITHM_RANGES_MOVE_H
0011
0012 #include <__algorithm/in_out_result.h>
0013 #include <__algorithm/iterator_operations.h>
0014 #include <__algorithm/move.h>
0015 #include <__config>
0016 #include <__iterator/concepts.h>
0017 #include <__ranges/access.h>
0018 #include <__ranges/concepts.h>
0019 #include <__ranges/dangling.h>
0020 #include <__utility/move.h>
0021
0022 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0023 # pragma GCC system_header
0024 #endif
0025
0026 _LIBCPP_PUSH_MACROS
0027 #include <__undef_macros>
0028
0029 #if _LIBCPP_STD_VER >= 20
0030
0031 _LIBCPP_BEGIN_NAMESPACE_STD
0032
0033 namespace ranges {
0034
0035 template <class _InIter, class _OutIter>
0036 using move_result = in_out_result<_InIter, _OutIter>;
0037
0038 struct __move {
0039 template <class _InIter, class _Sent, class _OutIter>
0040 _LIBCPP_HIDE_FROM_ABI constexpr static move_result<_InIter, _OutIter>
0041 __move_impl(_InIter __first, _Sent __last, _OutIter __result) {
0042 auto __ret = std::__move<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
0043 return {std::move(__ret.first), std::move(__ret.second)};
0044 }
0045
0046 template <input_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter>
0047 requires indirectly_movable<_InIter, _OutIter>
0048 _LIBCPP_HIDE_FROM_ABI constexpr move_result<_InIter, _OutIter>
0049 operator()(_InIter __first, _Sent __last, _OutIter __result) const {
0050 return __move_impl(std::move(__first), std::move(__last), std::move(__result));
0051 }
0052
0053 template <input_range _Range, weakly_incrementable _OutIter>
0054 requires indirectly_movable<iterator_t<_Range>, _OutIter>
0055 _LIBCPP_HIDE_FROM_ABI constexpr move_result<borrowed_iterator_t<_Range>, _OutIter>
0056 operator()(_Range&& __range, _OutIter __result) const {
0057 return __move_impl(ranges::begin(__range), ranges::end(__range), std::move(__result));
0058 }
0059 };
0060
0061 inline namespace __cpo {
0062 inline constexpr auto move = __move{};
0063 }
0064 }
0065
0066 _LIBCPP_END_NAMESPACE_STD
0067
0068 #endif
0069
0070 _LIBCPP_POP_MACROS
0071
0072 #endif