From patchwork Mon Dec 9 10:31:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fran=C3=A7ois_Dumont?= X-Patchwork-Id: 1206103 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515496-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Dtw1lwOj"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kFkhAFDN"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47Wfcw26kFz9sP6 for ; Mon, 9 Dec 2019 21:31:44 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=BXv5jQbX2TbST2smNKYx/FDxZxljOGsrfDfefAtwL7EIlJszg4 N+DvkPWuTsYOtcQare5QQteAuUn3dk2y87I8RWf2V8lO1aSZVaNRSBnx8s8r7aAW Mu2EZHaB2/Mw1Poiimu221zinAV8FgtuK+7dGsw3QqGLunRyudnkmcs2o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=FLgW7C9GHiZuju9GmhrG7KsIW/A=; b=Dtw1lwOjTPCn2GkXFgbB J9+xc/aMgO9kwwoa6DXmJEL0daSnaWyRlzAFvvBR+iukHDxYaJ7VXfgq5Qib9KqU w7hP8bLoqFNBI3uxMoXm0pTl1RTE0iaUnIThuXEhXJAOa+J/h8vGj3S1/V7/50q+ C3rebn8Mak8NWOh+zCmgh58= Received: (qmail 95970 invoked by alias); 9 Dec 2019 10:31:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 95953 invoked by uid 89); 9 Dec 2019 10:31:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-wm1-f52.google.com Received: from mail-wm1-f52.google.com (HELO mail-wm1-f52.google.com) (209.85.128.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Dec 2019 10:31:32 +0000 Received: by mail-wm1-f52.google.com with SMTP id g206so14878225wme.1; Mon, 09 Dec 2019 02:31:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=Necz66KZht94ROAe6fRIaS+e9mEpE4y3m4Gi7MuWjW8=; b=kFkhAFDNr1pcW1KRVWHP4aP90Wfb3VmJpkl9V7DUyqKsaMSSH7uniYu0FnHAHlOBBn CB79oNu8I+ImENcKvKNYmckjn2HlUuL+dQNNzNRgnpx26so234g+U7WMLe9Iphq1g0Cr 5cGI5pMAAf1JS97n7hIs1QrAb9mcyncSHfV4sAD9rI/YXWtcM9i37icKurq6vcWZJsif zhYsWzgIeK0I/SGb+x6XesQEYj1LatMHb6hcWBVmvrxcBqhcCVdaRJw1hFdAKLtzIHxl iDmOtkCy6BSlGF/B7/H3d8Jacv4aomlKLZP5+VBcXEqksllFG7yDVl418rZgynCMdkDf iySg== Received: from ?IPv6:2a01:e0a:1dc:b1c0:e5ff:368:85e7:dbaf? ([2a01:e0a:1dc:b1c0:e5ff:368:85e7:dbaf]) by smtp.googlemail.com with ESMTPSA id y139sm13504567wmd.24.2019.12.09.02.31.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Dec 2019 02:31:28 -0800 (PST) To: "libstdc++@gcc.gnu.org" , gcc-patches From: =?utf-8?q?Fran=C3=A7ois_Dumont?= Subject: [PATCH] Extend std::copy_n optimization Message-ID: Date: Mon, 9 Dec 2019 11:31:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 Last patch of my series following this one: https://gcc.gnu.org/ml/libstdc++/2019-12/msg00028.html This time I work on std::copy_n/std::copy overloads for istreambuf_iterator so that it works also for deque iterators and transparently in _GLIBCXX_DEBUG mode.     * include/bits/stl_algo.h (__copy_n_a): Move to ...     * include/bits/stl_algobase.h (__copy_n_a): ...here. Add __strict     parameter.     (__niter_base(const _Safe_iterator<_Ite, _Seq,     random_access_iterator_tag>&)): New declaration.     (__copy_move_a2(istreambuf_iterator<>, istreambuf_iterator<>,     _Deque_iterator<>)): New declaration.     (__copy_n_a(istreambuf_iterator<>, _Size, _Deque_iterator<>, bool)):     New declaration.     * include/bits/deque.tcc     (__copy_move_a2(istreambuf_iterator<>, istreambuf_iterator<>,     _Deque_iterator<>)): Add definition.     (__copy_n_a(istreambuf_iterator<>, _Size, _Deque_iterator<>, bool)):     Add definition.     * include/bits/streambuf_iterator.h     (__copy_n_a(istreambuf_iterator<>, _Size, _CharT*, bool)): Adapt     definition.     * include/debug/safe_iterator.tcc (__niter_base): Add definition.     * testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc (test03):     New.     * testsuite/25_algorithms/copy/streambuf_iterators/char/debug/     deque_neg.cc: New.     * testsuite/25_algorithms/copy_n/debug/istreambuf_ite_deque_neg.cc:     New.     * testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc: New.     * testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc: New. Tested under Linux x86_64 normal and debug modes. François diff --git a/libstdc++-v3/include/bits/deque.tcc b/libstdc++-v3/include/bits/deque.tcc index ef32d2d19dd..009b696e7c4 100644 --- a/libstdc++-v3/include/bits/deque.tcc +++ b/libstdc++-v3/include/bits/deque.tcc @@ -1065,6 +1065,57 @@ _GLIBCXX_END_NAMESPACE_CONTAINER return __result; } +#if __cplusplus >= 201103L + template + __enable_if_t<__is_char<_CharT>::__value, + _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*>> + __copy_move_a2( + istreambuf_iterator<_CharT, char_traits<_CharT> > __first, + istreambuf_iterator<_CharT, char_traits<_CharT> > __last, + _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*> __result) + { + if (__first == __last) + return __result; + + for (;;) + { + const auto __len = __result._M_last - __result._M_cur; + const auto __nb + = std::__copy_n_a(__first, __len, __result._M_cur, false) + - __result._M_cur; + __result += __nb; + + if (__nb != __len) + break; + } + + return __result; + } + + template + __enable_if_t<__is_char<_CharT>::__value, + _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*>> + __copy_n_a( + istreambuf_iterator<_CharT, char_traits<_CharT>> __it, _Size __size, + _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*> __result, + bool __strict) + { + if (__size == 0) + return __result; + + do + { + const auto __len = std::min<_Size>(__result._M_last - __result._M_cur, + __size); + std::__copy_n_a(__it, __len, __result._M_cur, __strict); + __result += __len; + __size -= __len; + } + while (__size != 0); + return __result; + } +#endif + template _OI diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index 769c27a02b6..4f2a6bbdbbf 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -775,31 +775,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __result; } - template - _GLIBCXX20_CONSTEXPR - _OutputIterator - __copy_n_a(_InputIterator __first, _Size __n, _OutputIterator __result) - { - if (__n > 0) - { - while (true) - { - *__result = *__first; - ++__result; - if (--__n > 0) - ++__first; - else - break; - } - } - 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 @@ -808,7 +783,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return std::__niter_wrap(__result, __copy_n_a(__first, __n, - std::__niter_base(__result))); + std::__niter_base(__result), true)); } template::value) { return __it; } + template + _Ite + __niter_base(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, + std::random_access_iterator_tag>&); + // Reverse the __niter_base transformation to get a // __normal_iterator back again (this assumes that __normal_iterator // is only used to wrap random access iterators, like pointers). @@ -484,6 +489,13 @@ namespace __detail } }; +_GLIBCXX_BEGIN_NAMESPACE_CONTAINER + + template + struct _Deque_iterator; + +_GLIBCXX_END_NAMESPACE_CONTAINER + // Helpers for streambuf iterators (either istream or ostream). // NB: avoid including , relatively large. template @@ -513,6 +525,16 @@ namespace __detail __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*); +#if __cplusplus >= 201103L + template + __enable_if_t<__is_char<_CharT>::__value, + _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*>> + __copy_move_a2( + istreambuf_iterator<_CharT, char_traits<_CharT> >, + istreambuf_iterator<_CharT, char_traits<_CharT> >, + _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*>); +#endif + template _GLIBCXX20_CONSTEXPR inline _OI @@ -529,13 +551,6 @@ namespace __detail _Category>::__copy_m(__first, __last, __result); } -_GLIBCXX_BEGIN_NAMESPACE_CONTAINER - - template - struct _Deque_iterator; - -_GLIBCXX_END_NAMESPACE_CONTAINER - template _OI @@ -594,6 +609,41 @@ _GLIBCXX_END_NAMESPACE_CONTAINER const ::__gnu_debug::_Safe_iterator<_IIte, _ISeq, _ICat>&, const ::__gnu_debug::_Safe_iterator<_OIte, _OSeq, _OCat>&); +#if __cplusplus >= 201103L + template + _GLIBCXX20_CONSTEXPR + _OutputIterator + __copy_n_a(_InputIterator __first, _Size __n, _OutputIterator __result, + bool) + { + if (__n > 0) + { + while (true) + { + *__result = *__first; + ++__result; + if (--__n > 0) + ++__first; + else + break; + } + } + return __result; + } + + template + __enable_if_t<__is_char<_CharT>::__value, _CharT*> + __copy_n_a(istreambuf_iterator<_CharT, char_traits<_CharT>>, + _Size, _CharT*, bool); + + template + __enable_if_t<__is_char<_CharT>::__value, + _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*>> + __copy_n_a(istreambuf_iterator<_CharT, char_traits<_CharT>>, _Size, + _GLIBCXX_STD_C::_Deque_iterator<_CharT, _CharT&, _CharT*>, + bool); +#endif + /** * @brief Copies the range [first,last) into result. * @ingroup mutating_algorithms diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h index f3a3bdf28f2..84d53ae9681 100644 --- a/libstdc++-v3/include/bits/streambuf_iterator.h +++ b/libstdc++-v3/include/bits/streambuf_iterator.h @@ -88,7 +88,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus >= 201103L template friend __enable_if_t<__is_char<_CharT2>::__value, _CharT2*> - __copy_n_a(istreambuf_iterator<_CharT2>, _Size, _CharT2*); + __copy_n_a(istreambuf_iterator<_CharT2>, _Size, _CharT2*, bool); #endif template @@ -384,7 +384,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #if __cplusplus >= 201103L template __enable_if_t<__is_char<_CharT>::__value, _CharT*> - __copy_n_a(istreambuf_iterator<_CharT> __it, _Size __n, _CharT* __result) + __copy_n_a(istreambuf_iterator<_CharT> __it, _Size __n, _CharT* __result, + bool __strict __attribute__((__unused__))) { if (__n == 0) return __result; @@ -394,7 +395,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ._M_iterator(__it)); _CharT* __beg = __result; __result += __it._M_sbuf->sgetn(__beg, __n); - __glibcxx_requires_cond(__result - __beg == __n, + __glibcxx_requires_cond(!__strict || __result - __beg == __n, _M_message(__gnu_debug::__msg_inc_istreambuf) ._M_iterator(__it)); return __result; diff --git a/libstdc++-v3/include/debug/safe_iterator.tcc b/libstdc++-v3/include/debug/safe_iterator.tcc index 15b1a361e58..75e1d2e6a23 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 + _Ite + __niter_base(const ::__gnu_debug::_Safe_iterator<_Ite, _Seq, + std::random_access_iterator_tag>& __it) + { return __it.base(); } + template _OI diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc index 3fd4e271521..ce44b538875 100644 --- a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc +++ b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/4.cc @@ -22,6 +22,7 @@ #include #include #include +#include #include @@ -76,9 +77,34 @@ void test02() VERIFY( !memcmp(buffer.data(), buffer_ref, 16500) ); } +void test03() +{ + using namespace std; + + typedef istreambuf_iterator in_iterator_type; + + ifstream fbuf_ref("istream_unformatted-1.txt"), + fbuf("istream_unformatted-1.txt"); + + char buffer_ref[16500]; + std::deque buffer(16500, 'a'); + + fbuf_ref.read(buffer_ref, 16500); + + in_iterator_type beg(fbuf); + in_iterator_type end; + copy(beg, end, buffer.begin()); + + VERIFY( fbuf_ref.good() ); + VERIFY( fbuf.good() ); + + VERIFY( std::equal(buffer.begin(), buffer.end(), buffer_ref) ); +} + int main() { test01(); test02(); + test03(); return 0; } diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/debug/deque_neg.cc b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/debug/deque_neg.cc new file mode 100644 index 00000000000..2f37857b9e8 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/copy/streambuf_iterators/char/debug/deque_neg.cc @@ -0,0 +1,46 @@ +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// { dg-do run { xfail *-*-* } } +// { dg-require-debug-mode "" } + +#include +#include +#include +#include + +void test01() +{ + using namespace std; + + typedef istreambuf_iterator in_iterator_type; + + const char data1[] = "Drei Phantasien nach Friedrich Holderlin"; + const string str1(data1); + istringstream iss1(str1); + in_iterator_type beg1(iss1); + in_iterator_type end1; + deque d(sizeof(data1) - 2, '0'); + + copy(beg1, end1, d.begin()); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/copy_n/debug/istreambuf_ite_deque_neg.cc b/libstdc++-v3/testsuite/25_algorithms/copy_n/debug/istreambuf_ite_deque_neg.cc new file mode 100644 index 00000000000..a821b380e61 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/copy_n/debug/istreambuf_ite_deque_neg.cc @@ -0,0 +1,50 @@ +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// { dg-do run { target c++11 xfail *-*-* } } +// { dg-require-fileio "" } +// { dg-require-debug-mode "" } + +#include +#include +#include +#include + +void test01() +{ + using namespace std; + + typedef istreambuf_iterator in_iterator_type; + + ifstream fbuf_ref("istream_unformatted-1.txt"), + fbuf("istream_unformatted-1.txt"); + + char buffer_ref[16500]; + deque dq(17000, 'a'); + + fbuf_ref.read(buffer_ref, 16500); + + in_iterator_type beg(fbuf); + copy_n(beg, 17000, dq.begin()); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc b/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc new file mode 100644 index 00000000000..fd45c438ee7 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/2.cc @@ -0,0 +1,56 @@ +// { dg-do run { target c++11 } } +// { dg-require-fileio "" } + +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include +#include + +#include + +void test01() +{ + using namespace std; + + typedef istreambuf_iterator in_iterator_type; + + ifstream fbuf_ref("istream_unformatted-1.txt"), + fbuf("istream_unformatted-1.txt"); + + char buffer_ref[16500], + buffer[16501]; + + fbuf_ref.read(buffer_ref, 16500); + + in_iterator_type beg(fbuf); + copy_n(beg, 16500, buffer); + + VERIFY( fbuf_ref.good() ); + VERIFY( fbuf.good() ); + + VERIFY( !memcmp(buffer, buffer_ref, 16500) ); +} + +int +main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc b/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc new file mode 100644 index 00000000000..69c57238caa --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/copy_n/istreambuf_iterator/deque.cc @@ -0,0 +1,56 @@ +// { dg-do run { target c++11 } } +// { dg-require-fileio "" } + +// Copyright (C) 2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include +#include + +#include + +void test01() +{ + using namespace std; + + typedef istreambuf_iterator in_iterator_type; + + ifstream fbuf_ref("istream_unformatted-1.txt"), + fbuf("istream_unformatted-1.txt"); + + char buffer_ref[16500]; + deque dq(16500, 'a'); + + fbuf_ref.read(buffer_ref, 16500); + + in_iterator_type beg(fbuf); + copy_n(beg, 16500, dq.begin()); + + VERIFY( fbuf_ref.good() ); + VERIFY( fbuf.good() ); + + VERIFY( equal(dq.begin(), dq.end(), buffer_ref) ); +} + +int +main() +{ + test01(); + return 0; +}