diff options
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__algorithm/copy_n.h')
-rw-r--r-- | contrib/llvm-project/libcxx/include/__algorithm/copy_n.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/contrib/llvm-project/libcxx/include/__algorithm/copy_n.h b/contrib/llvm-project/libcxx/include/__algorithm/copy_n.h index bbfeb8686fbf..38a84a4105a4 100644 --- a/contrib/llvm-project/libcxx/include/__algorithm/copy_n.h +++ b/contrib/llvm-project/libcxx/include/__algorithm/copy_n.h @@ -20,9 +20,6 @@ #pragma GCC system_header #endif -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - _LIBCPP_BEGIN_NAMESPACE_STD template<class _InputIterator, class _Size, class _OutputIterator> @@ -60,13 +57,12 @@ typename enable_if >::type copy_n(_InputIterator __first, _Size __orig_n, _OutputIterator __result) { + typedef typename iterator_traits<_InputIterator>::difference_type difference_type; typedef decltype(_VSTD::__convert_to_integral(__orig_n)) _IntegralSize; _IntegralSize __n = __orig_n; - return _VSTD::copy(__first, __first + __n, __result); + return _VSTD::copy(__first, __first + difference_type(__n), __result); } _LIBCPP_END_NAMESPACE_STD -_LIBCPP_POP_MACROS - #endif // _LIBCPP___ALGORITHM_COPY_N_H |