Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:20

0001 //===----------------------------------------------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef _LIBCPP___CXX03___ALGORITHM_RANGES_MOVE_H
0010 #define _LIBCPP___CXX03___ALGORITHM_RANGES_MOVE_H
0011 
0012 #include <__cxx03/__algorithm/in_out_result.h>
0013 #include <__cxx03/__algorithm/iterator_operations.h>
0014 #include <__cxx03/__algorithm/move.h>
0015 #include <__cxx03/__config>
0016 #include <__cxx03/__iterator/concepts.h>
0017 #include <__cxx03/__ranges/access.h>
0018 #include <__cxx03/__ranges/concepts.h>
0019 #include <__cxx03/__ranges/dangling.h>
0020 #include <__cxx03/__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 <__cxx03/__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 namespace __move {
0039 struct __fn {
0040   template <class _InIter, class _Sent, class _OutIter>
0041   _LIBCPP_HIDE_FROM_ABI constexpr static move_result<_InIter, _OutIter>
0042   __move_impl(_InIter __first, _Sent __last, _OutIter __result) {
0043     auto __ret = std::__move<_RangeAlgPolicy>(std::move(__first), std::move(__last), std::move(__result));
0044     return {std::move(__ret.first), std::move(__ret.second)};
0045   }
0046 
0047   template <input_iterator _InIter, sentinel_for<_InIter> _Sent, weakly_incrementable _OutIter>
0048     requires indirectly_movable<_InIter, _OutIter>
0049   _LIBCPP_HIDE_FROM_ABI constexpr move_result<_InIter, _OutIter>
0050   operator()(_InIter __first, _Sent __last, _OutIter __result) const {
0051     return __move_impl(std::move(__first), std::move(__last), std::move(__result));
0052   }
0053 
0054   template <input_range _Range, weakly_incrementable _OutIter>
0055     requires indirectly_movable<iterator_t<_Range>, _OutIter>
0056   _LIBCPP_HIDE_FROM_ABI constexpr move_result<borrowed_iterator_t<_Range>, _OutIter>
0057   operator()(_Range&& __range, _OutIter __result) const {
0058     return __move_impl(ranges::begin(__range), ranges::end(__range), std::move(__result));
0059   }
0060 };
0061 } // namespace __move
0062 
0063 inline namespace __cpo {
0064 inline constexpr auto move = __move::__fn{};
0065 } // namespace __cpo
0066 } // namespace ranges
0067 
0068 _LIBCPP_END_NAMESPACE_STD
0069 
0070 #endif // _LIBCPP_STD_VER >= 20
0071 
0072 _LIBCPP_POP_MACROS
0073 
0074 #endif // _LIBCPP___CXX03___ALGORITHM_RANGES_MOVE_H