220 39244 <67765220-1841-4d05-a797-fa28915cf4eb@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Standardising a type-erased iterator
Date: Fri, 20 Jul 2018 08:31:53 -0700 (PDT)
Lines: 92
Approved: news@gmane.org
Message-ID: <67765220-1841-4d05-a797-fa28915cf4eb@isocpp.org>
References: <09db196a-e818-4d7a-9af1-48f07b2f4c3d@isocpp.org>
 <a5e5d30a-cf5c-475d-94bb-ce4c92e82153@isocpp.org>
 <904aab35-44dd-4053-91d9-c02cbd4051a0@isocpp.org>
 <ed8626c1-44a6-4264-b072-1b902a31582b@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_5586_1962646602.1532100713454"
X-Trace: blaine.gmane.org 1532100589 7685 195.159.176.226 (20 Jul 2018 15:29:49 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 20 Jul 2018 15:29:49 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBB2UAZDNAKGQELLYTA2A@isocpp.org Fri Jul 20 17:29:45 2018
Return-path: <std-proposals+bncBCEKFTV6ZUMBB2UAZDNAKGQELLYTA2A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f199.google.com ([209.85.161.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBB2UAZDNAKGQELLYTA2A@isocpp.org>)
	id 1fgXLk-0001uY-I1
	for gclcip-std-proposals@m.gmane.org; Fri, 20 Jul 2018 17:29:44 +0200
Original-Received: by mail-yw0-f199.google.com with SMTP id 133-v6sf6526630ywq.4
        for <gclcip-std-proposals@m.gmane.org>; Fri, 20 Jul 2018 08:31:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=VbtxRdwi95dVLCS821CyqlXSKFDfgENu8VcY3nzNEI8=;
        b=Ciw0pei15Obst86t98tR6PvsjtR6OJ1eeAmoaqJK5mePO+/uvdVPrTb+UosxOzaX9P
         CtXR2yGkYb9aQHc1uKvu1tvkpc+NM43jDuuaCx7Jxqyyv/O171MOD6VLNuMgrsW0+YUv
         +wojUAVLtmB/jPFKhyhb1FIIJBluDu2HMqmzC9p4RRfJ3N+DZe3DO+PQ5Jx1/TtVyadG
         FxtLhUb/S+T8X5RPEkJ3W+D1oxCKSL8klAY9hE0RHLnalMdM7qLT/LCVDCszclWwzdMZ
         CxOMMWQKrzXIh2sLEORWyCRhHY2k8H1jiluraBR6/bNLQ6joenleYDMTxJE7aWLLRlTD
         QLRg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=VbtxRdwi95dVLCS821CyqlXSKFDfgENu8VcY3nzNEI8=;
        b=oCTzWCuv0JevsFyL2KZIMCatZvwEISzEconBqzl26qU/XzJIEqQwk2Rt5p5Qqgz3bE
         Z1z/oNeqmNnxx76JUlqMKCFPI9n/T0L4MYmXJToUhYdyiLK4wHTJ4R3Ig0VzEs5rlr8c
         Az3W8CeF3Ld9wl1aojsRxqw8mDastXLCBKLGtUwjJRe95GcnrxDTxc4oCIbuMSf+0Gfr
         /amHpYqamkcCSVL6hOa8FOc+PCUr/KlJ0W70k4syqFexa/DTnKGl5323DFDNTvD9lZ3H
         KUJRiU+C+Il9ZtR3owZtfdfvu5+nYPrAAdNxC4RkS1bKi1PXZmKPgF5KNgQ2owHrZmOt
         Q/OA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=VbtxRdwi95dVLCS821CyqlXSKFDfgENu8VcY3nzNEI8=;
        b=M0V/WOwKzYtpThPiOJWNbLxHjJD5Nzu0nViYSia+KtCV+Fu7zw/YlTFL3W+bmafumf
         bky+to7ee7CVSzvXq+C6//3AZXZlZAdWrrYQAQo7SV4MnyKF+wmlPqKO8EeRL248bwf9
         y/wvU/VuUoC4w3zG5ZHMXhLFeEbTz2aJo1ylXpoa4LjmTdDjANiXFk53uMip7jxURi4C
         9KgAI4mWnn6G8VF7FbB7w6H75E7ZLxC/gXx+5AbxUZ90AVgsM9ZHLo0gvWSTqXrfDdYU
         Y7UlWni4+1cS4xxmcxoO/XhJ1Q2nsMa4hEa2Md07pzwSC9DnU7cxwA6aaIxzICY5SZYQ
         eW5A==
X-Gm-Message-State: AOUpUlFxJLZ+s108mp4a5e099504Tjo1MPMjSSHgqINEjALGcAD+7o1e
	U0+hXe5ddsMxZmJ3KERgu1ZcvQ==
X-Google-Smtp-Source: AAOMgpfOQ5TAlAttNewSfkaOCUxnYOfYolpPYSEq0rBfgXBar3gayC0c4ilLMdWpuJeg8Y96YOIYQw==
X-Received: by 2002:a81:6e08:: with SMTP id j8-v6mr683905ywc.149.1532100715186;
        Fri, 20 Jul 2018 08:31:55 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a25:8008:: with SMTP id m8-v6ls473150ybk.11.gmail; Fri, 20
 Jul 2018 08:31:54 -0700 (PDT)
X-Received: by 2002:a25:c5d2:: with SMTP id v201-v6mr73004ybe.4.1532100713982;
        Fri, 20 Jul 2018 08:31:53 -0700 (PDT)
In-Reply-To: <ed8626c1-44a6-4264-b072-1b902a31582b@isocpp.org>
X-Original-Sender: jmckesson@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:39244
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39244>

------=_Part_5586_1962646602.1532100713454
Content-Type: multipart/alternative; 
	boundary="----=_Part_5587_1760712720.1532100713454"

------=_Part_5587_1760712720.1532100713454
Content-Type: text/plain; charset="UTF-8"

On Friday, July 20, 2018 at 9:48:09 AM UTC-4, Thomas Russell wrote:
>
> I agree that `any_iterator` is more useful than `any_iterator_ref`, and I 
> also agree that it's likely to do more harm than good. I guess in this case 
> the symmetry with `function` should be broken because of use-cases.
>
> I mention `any_range` and a potential `any_sentinel` in the draft 
> proposal, I do not think it is possible to have a standalone sentinel for 
> any_iterator, it would have to rely on a type-erased range.
>
> I think that `any_iterator` is independent enough to be considered alone, 
> and intend to write a proposal for `any_range` after this, with 
> `any_iterator` as a dependency.
>
> Do you think this would be a good strategy
>

`any_range` makes too much sense to not include in the proposal. C++ is 
(slowly) moving towards considering ranges as being fundamental constructs, 
so if `any_iterator` makes sense, so too does `any_range`.

I'm not sure if `any_sentinel` is even possible. Especially since it is the 
sentinel type which determines (statically) which iterators it can be 
sentinel's for. And you can't enumerate that list of iterator types, since 
the iterator itself could be a template. For example, iostreams could 
reasonably have a `stream_sentinel` that works for *all* 
`istream_iterator<T>`s.

As part of `any_range`, it would be possible to pass an iterator/sentinel 
pair and have the system erase both.

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/67765220-1841-4d05-a797-fa28915cf4eb%40isocpp.org.

------=_Part_5587_1760712720.1532100713454
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Friday, July 20, 2018 at 9:48:09 AM UTC-4, Thomas Russe=
ll wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">I agree that `any_ite=
rator` is more useful than `any_iterator_ref`, and I also agree that it&#39=
;s likely to do more harm than good. I guess in this case the symmetry with=
 `function` should be broken because of use-cases.<p>I mention `any_range` =
and a potential `any_sentinel` in the draft proposal, I do not think it is =
possible to have a standalone sentinel for any_iterator, it would have to r=
ely on a type-erased range.</p><p>I think that `any_iterator` is independen=
t enough to be considered alone, and intend to write a proposal for `any_ra=
nge` after this, with `any_iterator` as a dependency.</p><p>Do you think th=
is would be a good strategy</p></blockquote><div><br></div><div>`any_range`=
 makes too much sense to not include in the proposal. C++ is (slowly) movin=
g towards considering ranges as being fundamental constructs, so if `any_it=
erator` makes sense, so too does `any_range`.</div><div><br></div><div>I&#3=
9;m not sure if `any_sentinel` is even possible. Especially since it is the=
 sentinel type which determines (statically) which iterators it can be sent=
inel&#39;s for. And you can&#39;t enumerate that list of iterator types, si=
nce the iterator itself could be a template. For example, iostreams could r=
easonably have a `stream_sentinel` that works for <i>all</i> `istream_itera=
tor&lt;T&gt;`s.</div><div><br></div><div>As part of `any_range`, it would b=
e possible to pass an iterator/sentinel pair and have the system erase both=
..<br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/67765220-1841-4d05-a797-fa28915cf4eb%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/67765220-1841-4d05-a797-fa28915cf4eb=
%40isocpp.org</a>.<br />

------=_Part_5587_1760712720.1532100713454--

------=_Part_5586_1962646602.1532100713454--

.
