From: fdumont Date: Sun, 6 Oct 2019 15:53:51 +0000 (+0000) Subject: Add std::copy_n istreambuf_iterator specialization X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a53504c16e950ae473d7d7f54b63d21d41fc1adc;p=thirdparty%2Fgcc.git Add std::copy_n istreambuf_iterator specialization Commit this missing part which had been rejected. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@276640 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index 187c732d3048..661db0264ea1 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -778,8 +778,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template _GLIBCXX20_CONSTEXPR _OutputIterator - __copy_n(_InputIterator __first, _Size __n, - _OutputIterator __result, input_iterator_tag) + __copy_n_a(_InputIterator __first, _Size __n, _OutputIterator __result) { if (__n > 0) { @@ -795,6 +794,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } return __result; } + + template + __enable_if_t<__is_char<_CharT>::__value, _CharT*> + __copy_n_a(istreambuf_iterator<_CharT, char_traits<_CharT>>, + _Size, _CharT*); + + template + _GLIBCXX20_CONSTEXPR + _OutputIterator + __copy_n(_InputIterator __first, _Size __n, + _OutputIterator __result, input_iterator_tag) + { + return std::__niter_wrap(__result, + __copy_n_a(__first, __n, + std::__niter_base(__result))); + } template