summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/debug
diff options
context:
space:
mode:
authorFrançois Dumont <fdumont@gcc.gnu.org>2020-01-22 18:21:28 +0100
committerFrançois Dumont <fdumont@gcc.gnu.org>2020-06-04 22:27:47 +0200
commit4e05c918d28e3fa66f5baaf556f6886447c68c9a (patch)
tree43106801a994eaaf30b9ce5134b76ac524143f7d /libstdc++-v3/include/debug
parent8e788ac671626344fa79390808c4d02302387d0f (diff)
libstdc++: Specialize copy/copy_n for istreambuf_iterator and deque iterators
Add __copy_n_a overloads for std::deque iterators to replace with C memmove when possible. Expose std::copy_n implementation details in pre-C++11 modes and use it for std::copy overloads. libstdc++-v3/ChangeLog * include/bits/stl_algo.h (__copy_n_a): Move to ... * include/bits/stl_algobase.h (__copy_n_a): ...here. Add __strict parameter. (__copy_n_a(istreambuf_iterator<>, _Size, _Deque_iterator<>, bool)): Declare. (__niter_base(const _Safe_iterator<_Ite, _Seq, random_access_iterator_tag>&)): Declare. (__copy_move_a2(istreambuf_iterator<>, istreambuf_iterator<>, _Deque_iterator<>)): Declare. * include/bits/deque.tcc (__copy_move_a2(istreambuf_iterator<>, istreambuf_iterator<>, _Deque_iterator<>)): New. (__copy_n_a(istreambuf_iterator<>, _Size, _Deque_iterator<>, bool)): New. * include/bits/streambuf_iterator.h (__copy_n_a(istreambuf_iterator<>, _Size, _CharT*, bool)): Adapt. * include/debug/safe_iterator.tcc (__niter_base): New. * testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc (test03): New. * testsuite/25_algorithms/copy/streambuf_iterators/char/debug/deque_neg.cc: New test. * testsuite/25_algorithms/copy_n/debug/istreambuf_ite_deque_neg.cc: New test. * testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc: New test. * testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc: New test.
Diffstat (limited to 'libstdc++-v3/include/debug')
-rw-r--r--libstdc++-v3/include/debug/safe_iterator.tcc6
1 files changed, 6 insertions, 0 deletions
diff --git a/libstdc++-v3/include/debug/safe_iterator.tcc b/libstdc++-v3/include/debug/safe_iterator.tcc
index 312a88911ee..888ac803ae5 100644
--- a/libstdc++-v3/include/debug/safe_iterator.tcc
+++ b/libstdc++-v3/include/debug/safe_iterator.tcc
@@ -234,6 +234,12 @@ namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+ template<typename _Ite, typename _Seq>
+ _Ite
+ __niter_base(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq,
+ std::random_access_iterator_tag>& __it)
+ { return __it.base(); }
+
template<bool _IsMove,
typename _Ite, typename _Seq, typename _Cat, typename _OI>
_OI