From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 065943858C27; Sat, 11 Nov 2023 18:12:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 065943858C27 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 065943858C27 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699726324; cv=none; b=GACzemtoG660G1qZP3j8QyWr0YCN/dZNpmg7ptKh2ySz/OZtHptifdEpUxDG4V2uudjx0m7QEVZFR20tOev/KauzspfHdnxrAoSa/cLY59clv1Q6x2TI9UL/awhh9q/GCSfZW+tItl/UlnNYBH9zUOsrRJnJoApEpqRNeICQ+ys= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699726324; c=relaxed/simple; bh=OED2aDecsTrotEc2gQWXqunlgjylLA9O7c9mNGun28Q=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=wDxc2J7YZ8hkh8MNDha6sDM4ecvAo8znR3z9APRCxWQMEMvG4gPb15bfYapx/zZskfDG1bZLWAIalokgV31A8/UcQ4uDgGtuk7/sEEQLa808s2+mI2zMd+q7VJTuyxAea0blISnE9qeSqkNIaS8QJECIZlnRHjl/YmyrvHFxN64= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40a4a58cf80so5915325e9.2; Sat, 11 Nov 2023 10:11:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699726318; x=1700331118; darn=gcc.gnu.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=DY4jICuTtOvbk6rEtG0FREbWNf3ZdEHQjza5O9tqG6k=; b=OLuvHF3ieUBWCNbpgQdMZgwf43+RClenlo4uh98yfyENvYxMjTZDi0fnpI5sywFd8e 8FZ5ozWJDA0r7/WWzEut7Ckrdbjyysr7KFhKxDouAKhG76+LnIhkWoO86P14Mw00tzuR dZuMRKqAyXiYxuZCDV0/WZcOcy6bQWvxKpZOZPC3oUWnNkBEuhhk24A7tFOXaVkj/f3H 0PEe7r2N/Mgjt9kFfylCLgYqt7HUd0HqTZPfQxJS2qZ99cwE+xDneGokNfxSIlh8bd7l uzSnwfs2XpHagVCa5lhOY3PSr3tBPdSVTLvLP1MKb5fFG8wupX/gtwp5I5fpqNrbanLZ 74sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699726318; x=1700331118; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DY4jICuTtOvbk6rEtG0FREbWNf3ZdEHQjza5O9tqG6k=; b=gckI++hfiXbSJgDdDVPaw1QCjB53wjyVqBITDR2nFbPaaNvQhpxgoLU0ekVR2KiWFk Ft83JV3Yc7OSSxDLrsG6uRKus+31BlKUimC5S1o3KXHeAb50rMXqaxf6eDpYbqqagtV4 bvOBJdz8CqSTy8Eby/rdYemq15AgAjcvO7aynbpIEEMGHHqe/PGZXVhVENhTbpLODJLb k7Yoe693heHpHzG+MOq1qY83HgB13xNsgDsTnpNhb7Y9480/7GH/xWLgofsroUUcpYE4 ZiPoK0osmVZTwQIXQcMLmZPD9EFs9ziI3XoI1ix/VQdk4G0mVQ4MV28ywv+5mCsknEB+ qejA== X-Gm-Message-State: AOJu0YywxOPPDjDnzNyQe8jMNjNUkaDWZySQJ7HNWjWnIS92bzJUdPhi SgpeKw8nTQR8ydjNDWLoCibkNxdBAyWgmAJb8UdLWILr X-Google-Smtp-Source: AGHT+IFfZb3tET266PYmi9rRqmQq/riLwWTvrWruckczWKUYPd085DbzYZ1a5D3qLkqW4BudwPbHzLX3p/LWySK0o2g= X-Received: by 2002:a05:6000:1548:b0:32d:9a7c:56ed with SMTP id 8-20020a056000154800b0032d9a7c56edmr2038108wry.10.1699726318279; Sat, 11 Nov 2023 10:11:58 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Gonzalo Brito Gadeschi Date: Sat, 11 Nov 2023 10:11:47 -0800 Message-ID: Subject: Re: [PATCH v2] libstdc++: PSTL dispatch for C++20 range random access iterators [PR110512] To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org, pilarlatiesa@gmail.com Content-Type: multipart/alternative; boundary="0000000000006a9ed40609e45fc7" X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --0000000000006a9ed40609e45fc7 Content-Type: text/plain; charset="UTF-8" @Pilar, this is the patch. Let me know if you need any help or have questions. Thank you ! On Mon 3. Jul 2023 at 09:02, Gonzalo Brito Gadeschi < gonzalo.gadeschi@gmail.com> wrote: > libstdc++: Recognize C++ random access iterators as random access in PSTL > [PR110432] > > The check for random access iterators in the PSTL only checks whether the > iterator inherits from the random_access_iterator_tag, failing to recognize > random access iterators originating in C++20 ranges and views. > > This patch extends the check to also recognize types that model the C++20 > random_access_iterator concept as providing random access. > > This is allowed by C++23's P2408, which is safe to backport to C++20, > because > any application that would break already exhibits undefined > behavior due to precondition violation. > > libstdc++-v3/ChangeLog: > PR libstdc++/110512 > * include/pstl/execution_impl.h Recognize C++20 random access iterators as > random access. > > Bootstrapping and testing > * Tested with x86_64-pc-linux-gnu. > > --- > libstdc++-v3/include/pstl/execution_impl.h | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/libstdc++-v3/include/pstl/execution_impl.h > b/libstdc++-v3/include/pstl/execution_impl.h > index 64f6cc4357a..c17da29141e 100644 > --- a/libstdc++-v3/include/pstl/execution_impl.h > +++ b/libstdc++-v3/include/pstl/execution_impl.h > @@ -22,7 +22,15 @@ namespace __internal > > template > using __are_iterators_of = std::conjunction< > - std::is_base_of<_IteratorTag, typename > std::iterator_traits>::iterator_category>...>; > +#if __cplusplus >= 202002L > + std::disjunction< > + std::is_base_of<_IteratorTag, typename > std::iterator_traits>::iterator_category>, > + std::integral_constant std::random_access_iterator<_IteratorTypes>> > + >... > +#else // __cplusplus > + std::is_base_of<_IteratorTag, typename > std::iterator_traits>::iterator_category>... > +#endif // __cplusplus > +>; > > template > using __are_random_access_iterators = > __are_iterators_of; > > -- > 2.17.1 > --0000000000006a9ed40609e45fc7--