rotate_copy.h 1023 B

1234567891011121314151617181920212223242526272829
  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-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef _LIBCPP___ALGORITHM_ROTATE_COPY_H
  9. #define _LIBCPP___ALGORITHM_ROTATE_COPY_H
  10. #include <__algorithm/copy.h>
  11. #include <__config>
  12. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  13. # pragma GCC system_header
  14. #endif
  15. _LIBCPP_BEGIN_NAMESPACE_STD
  16. template <class _ForwardIterator, class _OutputIterator>
  17. inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _OutputIterator
  18. rotate_copy(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, _OutputIterator __result) {
  19. return std::copy(__first, __middle, std::copy(__middle, __last, __result));
  20. }
  21. _LIBCPP_END_NAMESPACE_STD
  22. #endif // _LIBCPP___ALGORITHM_ROTATE_COPY_H