220 33109 <fd09d6f6-d5c0-4443-b116-5160e12ce13e@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: =?UTF-8?Q?=5Bstd=2Dproposals=5D_Re=3A_Proposal_to_extend_range=2Dbased_?=
	=?UTF-8?Q?=E2=80=98for=E2=80=99_loop_example=3A__for=281=3A10=29?=
Date: Tue, 4 Jul 2017 13:33:42 -0700 (PDT)
Lines: 136
Approved: news@gmane.org
Message-ID: <fd09d6f6-d5c0-4443-b116-5160e12ce13e@isocpp.org>
References: <524ec202-94cf-44cf-af4b-ff1339e6f394@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2653_488252739.1499200422996"
X-Trace: blaine.gmane.org 1499200425 30084 195.159.176.226 (4 Jul 2017 20:33:45 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 4 Jul 2017 20:33:45 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBJ7X57FAKGQEISPOJYI@isocpp.org Tue Jul 04 22:33:41 2017
Return-path: <std-proposals+bncBCEKFTV6ZUMBBJ7X57FAKGQEISPOJYI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f197.google.com ([209.85.220.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBJ7X57FAKGQEISPOJYI@isocpp.org>)
	id 1dSUVw-0007ZR-7t
	for gclcip-std-proposals@m.gmane.org; Tue, 04 Jul 2017 22:33:40 +0200
Original-Received: by mail-qk0-f197.google.com with SMTP id g89sf107440307qkh.15
        for <gclcip-std-proposals@m.gmane.org>; Tue, 04 Jul 2017 13:33:45 -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=z3Pg1AlOAdnfLWnthSAkg42hCH6mwhCGY3Lk8wIKuTc=;
        b=Haz7VamxlXT5uw/dQUzZCSEdpVlcW0RoJprwA5GekngrArsceq4xgA68cYIjOwoEo9
         cS7TF0GCyx4NaAtfn7Kzgb4NNfx/n3YlEI3WU8sJ0PfU4gr7GVw0/9Uygl+gzM43j5xh
         PYg61IU49cWQjzQh5X4nLULvCusg7huw/AekhWKTNmLDOKWGotRZ+n3IzmYxoCekGDVz
         dDJ8y99Clev3RcyNDsyE9YBbnnxQ4wwahbO1mUxehCD9Llr6IqrKdXd74rPGOjHxkLQV
         50ty/UxV6QJNmOshXYeqFwvOyF1YdiCsnRjYBSsKNPJNFWI04okjjavzpxsN0XknsANM
         /06g==
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=z3Pg1AlOAdnfLWnthSAkg42hCH6mwhCGY3Lk8wIKuTc=;
        b=LSf9ZODspHJWbvYvjUJMGey2cWSRp8Wz7DyvEIYaHnPaXo72CiBh1NEsmLoZqMqTf7
         TUJYQ8dW4Huy+bHt/pEkLgfik9xSIV7Uf97fQvt5+nHv0GdJ4UYv+WrSedfEaDj7Pj0o
         hbGMXwWhvJAB+9T1EIVCk/1xY9GWKriRbMeyYJEd+cdIF9jNf1Br2lL9TaI9V9zVpJ3W
         4V9616CSBQeKYL6QEdhcEPLWG14Cft7dz2iUi0tpxCi5+TLZ4vIoN5kUgPsH0+ocPqSu
         POQ3v+e+hmegZU/HV/VSFE/BmI5G59lPpOLkoFLyIszRlUgpFnZVG7DKj1TRxjnzO8Ry
         rRZA==
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=z3Pg1AlOAdnfLWnthSAkg42hCH6mwhCGY3Lk8wIKuTc=;
        b=bJJUO+/HYk5cSb0kfo+okgw5GmFPSLdTnO166i5kQP+KPkXq0s+vN3B/zh43SCH+Bm
         6OShURGZ3HBv1G4GQFCdWbKRRtAqK/DsvTf6z8yk6Z1ObtWSQYQBq7AvL11yhzvtvqPu
         3G/CZoAzs3k57WBy6r2rJwAB8uK9+yUPup+wLWsxH0cO1gauXIILMgw9btqboWnOXmEe
         EC3izcGwwwG94SxK8RMDIamT9R4TEu4ZtLxr1xmfWBgilYw2arRxDBWDI5PVj7R+v6JO
         8p9H5DSe8Cp1mhMn3ztWoldIsUwUVasu/MVTImLpfehU+hHfpw5ZQVCOpLT4zOvsSSrw
         xTEg==
X-Gm-Message-State: AIVw110SqDRBpJqThLHsF5Xvx64RGuh6YZoWFtyMcIA2Jg6J+nsldfr7
	yMnQAtLtwh9hls+3
X-Received: by 10.200.3.80 with SMTP id w16mr14929439qtg.64.1499200425370;
        Tue, 04 Jul 2017 13:33:45 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.94.142 with SMTP id h136ls8861855itb.0.gmail; Tue, 04 Jul
 2017 13:33:43 -0700 (PDT)
X-Received: by 10.36.3.72 with SMTP id e69mr1361963ite.1.1499200423692;
        Tue, 04 Jul 2017 13:33:43 -0700 (PDT)
In-Reply-To: <524ec202-94cf-44cf-af4b-ff1339e6f394@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-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:33109
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33109>

------=_Part_2653_488252739.1499200422996
Content-Type: multipart/alternative; 
	boundary="----=_Part_2654_563973965.1499200422996"

------=_Part_2654_563973965.1499200422996
Content-Type: text/plain; charset="UTF-8"



On Tuesday, July 4, 2017 at 2:20:37 PM UTC-4, Abdulla Herzallah wrote:
>
> HI ISO C++ Standard committee,
>   
> Apology if I am not following a proper specifications draft, I hope it 
> will be reviewed by someone who can help in *evaluating or enhancing* 
> this proposal.
>

Here's an even better idea:

for(auto i; std::ints(10))
{
}

Now we don't have to extend anything. We add one standard library function, 
and we get everything you need. We can even add a literal to make getting 
`size_t`s easier:

for(auto i; std::ints(10z))
{
}

Speaking of literals, we can even have literals that do the entire job, so 
we don't need `std::ints` at all:

for(auto i; 10rng)
{
}

In short, there is no good reason to extend the language to do this. We 
have plenty of tools to do the job adequately ourselves.

-- 
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/fd09d6f6-d5c0-4443-b116-5160e12ce13e%40isocpp.org.

------=_Part_2654_563973965.1499200422996
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Tuesday, July 4, 2017 at 2:20:37 PM UTC-4, Abdu=
lla Herzallah wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;ma=
rgin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr">HI ISO C++ Standard committee,<div>=C2=A0=C2=A0<div>Apology if I a=
m not following a proper specifications draft, I hope it will be reviewed b=
y someone who can help in <u>evaluating or enhancing</u> this proposal.</di=
v></div></div></blockquote><div><br>Here&#39;s an even better idea:<br><br>=
<div style=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, =
187, 187); border-style: solid; border-width: 1px; overflow-wrap: break-wor=
d;" class=3D"prettyprint"><code class=3D"prettyprint"><div class=3D"subpret=
typrint"><span style=3D"color: #008;" class=3D"styled-by-prettify">for</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span s=
tyle=3D"color: #008;" class=3D"styled-by-prettify">auto</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> i</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> std</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">ints</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">(</span><span style=3D"color: #066;" class=3D"styled-by-prettify"=
>10</span><span style=3D"color: #660;" class=3D"styled-by-prettify">))</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br></span></div></code></div><br>Now we do=
n&#39;t have to extend anything. We add one standard library function, and =
we get everything you need. We can even add a literal to make getting `size=
_t`s easier:<br><br><div style=3D"background-color: rgb(250, 250, 250); bor=
der-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; over=
flow-wrap: break-word;" class=3D"prettyprint"><code class=3D"prettyprint"><=
div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">for</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">auto=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> i</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> std</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">ints</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">(</span><span style=3D"color: #066;" class=3D"s=
tyled-by-prettify">10z</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">))</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">{<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br></span></div></code></=
div><br>Speaking of literals, we can even have literals that do the entire =
job, so we don&#39;t need `std::ints` at all:<br><br><div style=3D"backgrou=
nd-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-styl=
e: solid; border-width: 1px; overflow-wrap: break-word;" class=3D"prettypri=
nt"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=
=3D"color: #008;" class=3D"styled-by-prettify">for</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> i</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">1=
0rng</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">}</span></div></code></div><br>In =
short, there is no good reason to extend the language to do this. We have p=
lenty of tools to do the job adequately ourselves.<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/fd09d6f6-d5c0-4443-b116-5160e12ce13e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/fd09d6f6-d5c0-4443-b116-5160e12ce13e=
%40isocpp.org</a>.<br />

------=_Part_2654_563973965.1499200422996--

------=_Part_2653_488252739.1499200422996--

.
