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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id B0BC53858282 for ; Wed, 27 Mar 2024 12:46:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B0BC53858282 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B0BC53858282 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711543570; cv=none; b=cUNcfHr3Xf2/J22zw53ww7o8h12OVtk1HtQkwHpd9QRyBKxoZ1433iNpQ/TePUvBIRMQIB5KDmiUSnd6Y6G+TKUM6l2KMccNIoOU0D/n/cSdsUs8DRxDNTiJCnSACYXJRILC6A4l0CBiDgs7bXHY/euMils9Nnxs1b/D5i67zYo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711543570; c=relaxed/simple; bh=QE671OZCqi87cAiNDRj4IkYQhujxmVOmaav1L1glDcQ=; h=DKIM-Signature:From:Date:To:Subject:Message-ID:MIME-Version; b=ZAU5ljtBhNhneSNuoayophaqwACXb4UuNuDjGQARyTTdlGbMP648mT7apRk4F+6RZFtZ9i/sYxErJssdkYBOji+ZSAaCvCUlVX7aGJr6Z7bwImuA4VZKcJEi6OhI3yWbFrrikE/onN9fePZrybsphGdjw/20xYYD10aQboa2mGc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711543568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IP1U5+PeZQByDrXvHFKYrxU3F5+w+J3huS2XJkDjD3E=; b=bY74b8QP70cjoDpeDIdedKDeZGy0J+0GJslVfmIGrEBouUOj2+Gcv+J/6v/W/c55xXwJp4 3S9QVQMapaA8u7iBFhA7BiiLJq6sTfGjnFE1JhezNcPV7jcW6C2sPeNSBVVw2Zzr2ROgDq L7HybCWld3M0nMmXPj6hKt0DV6lGlvw= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-358-Aj2sHMFHOzu018vdzAN8pg-1; Wed, 27 Mar 2024 08:46:07 -0400 X-MC-Unique: Aj2sHMFHOzu018vdzAN8pg-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-6965b4344b5so66762336d6.3 for ; Wed, 27 Mar 2024 05:46:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711543566; x=1712148366; h=mime-version:references:message-id:in-reply-to:subject:cc:to:date :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tjMXG+vjANNB5YivyUDw+bquBLM5uX6yQH0uFCoWY1I=; b=iPdY6b/uCoNF+yNz8q+rt1Bb9NP7oCDgJBKlAfMkUlTcyWrJmNPs6ezmobxiEmKuvo 55HZCAi0/uqpqHI+C27RVd8djGDCY0DeB0CZcO0LUEos4q+fSlogYXxNpS44MpQEyWWL jbahSHofQBKDDqTf4cE36F/FCLM2RP3x8fXPOUR29JGyDiccKzfECeTHQb3cQFpP1kwR t90bQlZ19DLUJUlkNSaMtf+WN/IRBUfAxBRRRHadnESPXGTfDf8uzxGZrTGz0v5lNlWm Ny+lgL8/u4ZSqvLDlPec9fkcC2LkybB3VOqtCQMWWNesOoLHdYhzvLpruG5JqGpF0XRF AlAw== X-Forwarded-Encrypted: i=1; AJvYcCU8WmY4gGhgvo/5CE3Be+5BPDZHP5DMwdil6NkBG+0zmOccSx5JLlFSsxRk8MMvpIW7nhBx2PZ/ZHX9wh5Pg4MEmGM0n90= X-Gm-Message-State: AOJu0YxFKHMYqy/+GddbyjNTg6qW9bY2mv+oKxjPDH9PI2oHupQ3uABc Pzqpy/wLDBslxYPB4rASt4GoEIKZMg5vjA1pgq/TwVKmgHLEu6skHNzwOxpmdkMBDE+qU4wB4aO t0X7ljFqu8/8kOMO/hmsNEreWFVJSflrjqCeIDHC7WaEAX54alKVR X-Received: by 2002:a05:6214:411e:b0:690:a800:8ffa with SMTP id kc30-20020a056214411e00b00690a8008ffamr5914915qvb.31.1711543566588; Wed, 27 Mar 2024 05:46:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdRp+ENxXMoOCKrvlVN85Af63IC0+PB8pbWyuost1NgeLPjIBIKazRJzDtc5qxW5ueliCWPg== X-Received: by 2002:a05:6214:411e:b0:690:a800:8ffa with SMTP id kc30-20020a056214411e00b00690a8008ffamr5914899qvb.31.1711543566288; Wed, 27 Mar 2024 05:46:06 -0700 (PDT) Received: from [192.168.1.130] (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id u9-20020a0562141c0900b006915269936bsm6231994qvc.25.2024.03.27.05.46.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 05:46:05 -0700 (PDT) From: Patrick Palka X-Google-Original-From: Patrick Palka Date: Wed, 27 Mar 2024 08:46:05 -0400 (EDT) To: Jonathan Wakely cc: Patrick Palka , gcc-patches , libstdc++ Subject: Re: [PATCH] libstdc++/ranges: Define _S_has_simple_call_op on newer adaptors In-Reply-To: Message-ID: References: <20240117023641.3389770-1-ppalka@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="8323329-1775766949-1711543565=:3760645" X-Spam-Status: No, score=-12.9 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,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_NONE,TXREP 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: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1775766949-1711543565=:3760645 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Wed, 17 Jan 2024, Jonathan Wakely wrote: > > > On Wed, 17 Jan 2024, 02:37 Patrick Palka, wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? > > > OK Thanks a lot. For the record I ended up not pushing this patch because all the range adaptors it touches are C++23 ones and so ... > > > > -- >8 -- > > This compile-time and diagnostic improvement[1] is less important in > C++23 mode where deducing this is available and used in _Pipe, but for > benefit of C++20 mode ... this isn't true. There's no real benefit in setting this flag for standard C++23 range adaptors (besides consistency I guess, but OTOH not setting it means more testing coverage for the deducing this code path). > and for consistency let's set the flag on the most > recently added range adaptors which lack it. > > [1]: Defining _S_has_simple_call_op=true for a range adaptor closure > object signals that the adaptor has an operator() that's not overloaded > according to the constness/value category of the object, which in turn > allows us to implement the operator() of the composition of such adaptors > in a simpler way. > > libstdc++-v3/ChangeLog: > >         * include/std/ranges (views::_Adjacent::_S_has_simple_call_op): >         Define to true. >         (views::_AsRvalue::_S_has_simple_call_op): Likewise. >         (views::_Enumerate::_S_has_simple_call_op): Likewise. >         (views::_AsConst::_S_has_simple_call_op): Likewise. > --- >  libstdc++-v3/include/std/ranges | 8 ++++++++ >  1 file changed, 8 insertions(+) > > diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges > index 7ef835f486a..66502cc1da4 100644 > --- a/libstdc++-v3/include/std/ranges > +++ b/libstdc++-v3/include/std/ranges > @@ -5669,6 +5669,8 @@ namespace views::__adaptor >             else >               return adjacent_view, _Nm>(std::forward<_Range>(__r)); >           } > + > +       static constexpr bool _S_has_simple_call_op = true; >        }; > >      template > @@ -8844,6 +8846,8 @@ namespace views::__adaptor >           else >             return as_rvalue_view(std::forward<_Range>(__r)); >         } > + > +      static constexpr bool _S_has_simple_call_op = true; >      }; > >      inline constexpr _AsRvalue as_rvalue; > @@ -9147,6 +9151,8 @@ namespace views::__adaptor >         constexpr auto >         operator() [[nodiscard]] (_Range&& __r) const >         { return enumerate_view>(std::forward<_Range>(__r)); } > + > +      static constexpr bool _S_has_simple_call_op = true; >      }; > >      inline constexpr _Enumerate enumerate; > @@ -9253,6 +9259,8 @@ namespace views::__adaptor >         else >           return as_const_view(std::forward<_Range>(__r)); >        } > + > +      static constexpr bool _S_has_simple_call_op = true; >      }; > >      inline constexpr _AsConst as_const; > -- > 2.43.0.367.g186b115d30 > > > --8323329-1775766949-1711543565=:3760645--