From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 06851388703D for ; Wed, 4 Nov 2020 13:36:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 06851388703D Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-589-IC_Fi4YFMMqYD38gngVYDg-1; Wed, 04 Nov 2020 08:36:46 -0500 X-MC-Unique: IC_Fi4YFMMqYD38gngVYDg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C7F70907E2E; Wed, 4 Nov 2020 13:36:45 +0000 (UTC) Received: from localhost (unknown [10.33.36.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 48FF75D9CC; Wed, 4 Nov 2020 13:36:44 +0000 (UTC) Date: Wed, 4 Nov 2020 13:36:44 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Define new C++17 std::search overload for Parallel Mode [PR 94971] Message-ID: <20201104133644.GA3201906@redhat.com> MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2020 13:36:50 -0000 --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline libstdc++-v3/ChangeLog: PR libstdc++/94971 * include/bits/stl_algo.h (search(FIter, FIter, const Searcher): Adjust #if condition. * include/parallel/algo.h (search(FIter, FIter, const Searcher&): Define new overload for C++17. Tested powerpc64le-linux. Committed to trunk. --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit e0af865ab9d9d5b6b3ac7fdde26cf9bbf635b6b4 Author: Jonathan Wakely Date: Wed Nov 4 13:36:32 2020 libstdc++: Define new C++17 std::search overload for Parallel Mode [PR 94971] libstdc++-v3/ChangeLog: PR libstdc++/94971 * include/bits/stl_algo.h (search(FIter, FIter, const Searcher): Adjust #if condition. * include/parallel/algo.h (search(FIter, FIter, const Searcher&): Define new overload for C++17. diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index 621c6331422e..6efc99035b7d 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -4243,7 +4243,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO __gnu_cxx::__ops::__iter_comp_val(__binary_pred, __val)); } -#if __cplusplus > 201402L +#if __cplusplus >= 201703L /** @brief Search a sequence using a Searcher object. * * @param __first A forward iterator. diff --git a/libstdc++-v3/include/parallel/algo.h b/libstdc++-v3/include/parallel/algo.h index cec6fd003c38..4b6dcc841191 100644 --- a/libstdc++-v3/include/parallel/algo.h +++ b/libstdc++-v3/include/parallel/algo.h @@ -1049,6 +1049,21 @@ namespace __parallel std::__iterator_category(__begin2)); } +#if __cplusplus >= 201703L + /** @brief Search a sequence using a Searcher object. + * + * @param __first A forward iterator. + * @param __last A forward iterator. + * @param __searcher A callable object. + * @return @p __searcher(__first,__last).first + */ + template + inline _ForwardIterator + search(_ForwardIterator __first, _ForwardIterator __last, + const _Searcher& __searcher) + { return __searcher(__first, __last).first; } +#endif + // Sequential fallback template inline _FIterator --u3/rZRmxL6MmkK24--