From e324f9cb921234b80c809f8ffbd7ef2d55d583bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Dumont?= Date: Mon, 20 Nov 2017 22:30:28 +0000 Subject: streambuf_iterator.h (istreambuf_iterator<>): Declare std::advance for istreambuf_iterator of char types to be friend. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2017-11-20 François Dumont * include/bits/streambuf_iterator.h (istreambuf_iterator<>): Declare std::advance for istreambuf_iterator of char types to be friend. (std::advance(istreambuf_iterator&, _Distance)): New overload. * include/std/streambuf (basic_streambuf<>): Declare std::advance for istreambuf_iterator of char types to be friend. * testsuite/22_locale/money_get/get/char/9.cc: Have istreambuf_iterator created on the fly when calling money_get<>::get. * testsuite/22_locale/money_get/get/wchar_t/9.cc: Likewise. * testsuite/24_iterators/istreambuf_iterator/debug/1_neg.cc: New. * testsuite/24_iterators/istreambuf_iterator/debug/2_neg.cc: New. * testsuite/25_algorithms/advance/istreambuf_iterators/char/1.cc: New. * testsuite/25_algorithms/advance/istreambuf_iterators/char/1_neg.cc: New. * testsuite/25_algorithms/advance/istreambuf_iterators/char/2.cc: New. * testsuite/25_algorithms/advance/istreambuf_iterators/char/2_neg.cc: New. * testsuite/25_algorithms/advance/istreambuf_iterators/char/3_neg.cc: New. * testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/1.cc: New. * testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/1_neg.cc: New. * testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2.cc: New. * testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/2_neg.cc: New. * testsuite/25_algorithms/advance/istreambuf_iterators/wchar_t/3_neg.cc: New. * testsuite/25_algorithms/find/istreambuf_iterators/char/2.cc: Leverage on std::advance overload. * testsuite/25_algorithms/find/istreambuf_iterators/wchar_t/2.cc: Likewise. From-SVN: r254972 --- libstdc++-v3/include/std/streambuf | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libstdc++-v3/include/std/streambuf') diff --git a/libstdc++-v3/include/std/streambuf b/libstdc++-v3/include/std/streambuf index a05b46e8199..c1fd395b827 100644 --- a/libstdc++-v3/include/std/streambuf +++ b/libstdc++-v3/include/std/streambuf @@ -159,6 +159,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION find(istreambuf_iterator<_CharT2>, istreambuf_iterator<_CharT2>, const _CharT2&); + template + friend typename __gnu_cxx::__enable_if<__is_char<_CharT2>::__value, + void>::__type + advance(istreambuf_iterator<_CharT2>&, _Distance); + template friend basic_istream<_CharT2, _Traits2>& operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2*); -- cgit v1.2.3