220 14857 <5480A0D8.2020609@wanadoo.fr> article
Path: news.gmane.org!not-for-mail
From: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Variable declarations inside test before block
Date: Thu, 04 Dec 2014 18:58:48 +0100
Lines: 510
Approved: news@gmane.org
Message-ID: <5480A0D8.2020609@wanadoo.fr>
References: <ba7d4c88-df31-474a-8216-60772e2e3405@isocpp.org> <afd0d998-e75a-487a-96f2-5c410a86ce54@isocpp.org> <1b00c799-b47e-48b7-8717-9953b1845cca@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------000904090105090508000106"
X-Trace: ger.gmane.org 1417715940 26103 80.91.229.3 (4 Dec 2014 17:59:00 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 4 Dec 2014 17:59:00 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDH67CONY4PBBWWBQKSAKGQED6KXYAI@isocpp.org Thu Dec 04 18:58:51 2014
Return-path: <std-proposals+bncBDH67CONY4PBBWWBQKSAKGQED6KXYAI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ee0-f71.google.com ([74.125.83.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDH67CONY4PBBWWBQKSAKGQED6KXYAI@isocpp.org>)
	id 1Xwafz-0005dW-7R
	for gclcip-std-proposals@m.gmane.org; Thu, 04 Dec 2014 18:58:51 +0100
Original-Received: by mail-ee0-f71.google.com with SMTP id c13sf11438022eek.2
        for <gclcip-std-proposals@m.gmane.org>; Thu, 04 Dec 2014 09:58:50 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to
         :subject:references:in-reply-to:content-type:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=SxeKoKmZ2Yw5m25fJbRpv9G3fa/LSZ+654aKi4mU7vY=;
        b=BJxds5WiDqDSITfgR+BvwXqmhI8/qoHAxN/WnOWD43g9r5pPt8NENXO47fQS5bZ+PW
         a/47Woo32AIOgZUyBOV4UEy+XyVofJj5DSAOSwIBrtD/Oh7G73gXLbbBol8NCrE/Ky7c
         S8wLH0rrKEaRAPkar4l3mHUAC/2tjR9pWC5XTFsMvZGPFpHDT6k5wkwIl2mudVtTXK7H
         QFLb7y0lB9mzdIFKGIRm1uolgFC0+WWOLpgW03yEmLVUqFmyGOH1hi7+JWGf0KAlO7OH
         T9+1E8uWcri+U5JABYB85rG/F2iC8c7ugiGv+zFftfSrgRKic07x6udXlFR35Jty60Wn
         YWog==
X-Gm-Message-State: ALoCoQmEEhZfoHWOBkZCrqQ6RTyawEcWEn3lC+40/p8gbkF+4kiI4ExUu/WJRU5ZqjbgYf7c5QDN
X-Received: by 10.112.159.199 with SMTP id xe7mr3296lbb.21.1417715930873;
        Thu, 04 Dec 2014 09:58:50 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.89.100 with SMTP id bn4ls103772wib.47.gmail; Thu, 04 Dec
 2014 09:58:49 -0800 (PST)
X-Received: by 10.194.170.232 with SMTP id ap8mr18027979wjc.2.1417715929735;
        Thu, 04 Dec 2014 09:58:49 -0800 (PST)
Original-Received: from smtp.smtpout.orange.fr (smtp08.smtpout.orange.fr. [80.12.242.130])
        by mx.google.com with ESMTP id ex8si45944672wjb.33.2014.12.04.09.58.49
        for <std-proposals@isocpp.org>;
        Thu, 04 Dec 2014 09:58:49 -0800 (PST)
Received-SPF: none (google.com: vicente.botet@wanadoo.fr does not designate permitted sender hosts) client-ip=80.12.242.130;
Original-Received: from new-host.home ([92.139.157.31])
	by mwinf5d43 with ME
	id PVyo1p00E0gveUk03Vyoya; Thu, 04 Dec 2014 18:58:49 +0100
X-ME-Helo: new-host.home
X-ME-Auth: dmljZW50ZS5ib3RldEB3YW5hZG9vLmZy
X-ME-Date: Thu, 04 Dec 2014 18:58:49 +0100
X-ME-IP: 92.139.157.31
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To: <1b00c799-b47e-48b7-8717-9953b1845cca@isocpp.org>
X-Original-Sender: vicente.botet@wanadoo.fr
X-Original-Authentication-Results: mx.google.com;       spf=none (google.com:
 vicente.botet@wanadoo.fr does not designate permitted sender hosts) smtp.mail=vicente.botet@wanadoo.fr
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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:14857
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14857>

This is a multi-part message in MIME format.
--------------000904090105090508000106
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Le 04/12/14 08:09, squelart@gmail.com a =C3=A9crit :
> On Wednesday, December 3, 2014 7:37:24 PM UTC+11, Andrzej Krzemie=C5=84sk=
i=20
> wrote:
>
>     W dniu =C5=9Broda, 3 grudnia 2014 05:21:27 UTC+1 u=C5=BCytkownik
>     sque...@gmail.com napisa=C5=82:
>
>         (First time here, please let me know if I'm doing anything wrong!=
)
>
>         Just a quick idea I couldn't find elsewhere with a quick
>         search, I was wondering if it had already been proposed and/or
>         rejected:
>
>         Would it be possible and useful to allow variable declarations
>         inside a test preceding a block, and make these variables
>         visible inside the remainder of the test and the block?
>         (The "remainder of the test" part might be going too far?)
>         The goal is to avoid polluting a block with variables that are
>         really only needed inside an inner block.
>
>         E.g.:
>         |
>         if((autototal <(automax =3DgetMax())-(autobuffer =3Dmax /3))>1){
>         // 'total', 'max' and 'buffer' are visible in this block and
>         destructed at the end.
>         }
>
>         while(nullptr!=3D(void*buffer =3Dmalloc(8))){foo(buffer);}
>
>         for(inti =3D0;i <(intend=3D10);++i){cout <<end-i;}
>
>         switch(charc =3Dgetchar()){case'\0':break;default:cout <<c;}
>
>         autof =3D(P*p =3DmaybeP())?p->foo():0;// Too far again?
>         |
>
>         Any pointers/suggestions/criticisms welcome.
>         I'd be happy to work on it further if there's any interest.
>
>     Note that some of the above constructs are already valid in C++.
>     |
>     |
>     while(void*buffer =3Dmalloc(8))//
>       foo(buffer);// valid C++
>
>     for(inti =3D0,end=3D10;i <end;++i)// different than your example
>     {cout <<end-i;}// but similar functionality
>
>     switch(charc =3Dgetchar())// valid C++
>     {
>     case'\0':break;
>     default:cout <<c;
>     }
>
>     for(iter.init();int*i =3Diter.next();)// valid C++
>     use(*i);
>     |
>
>     |Your proposal offers only a bit more. The question is, whether
>     the added value counterweights the costs of standardization
>     effort, complicating the language, more rules for programmers to
>     learn, compiler updates, etc. My personal answer (based on
>     feelings and intuition only) is that it is not worth it.
>
>     Regards,
>     &rzej
>
>
> Thanks for your help, I didn't know about some of these. Always learning!
>
> I knew about "while (void* p =3D ...)", but it means the variable can=20
> only be tested for "falsiness", you can't have a test that declares a=20
> variable and compares it to an arbitrary non-false value.
>
while ((void* p =3D ...) =3D=3D 0) ...
> But as you say, it's "only a bit more", so it's probably not worth the=20
> huge effort to change the language just for that...
>
Agreed,
Vicente

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--------------000904090105090508000106
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta content=3D"text/html; charset=3DUTF-8" http-equiv=3D"Content-Type=
">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <div class=3D"moz-cite-prefix">Le 04/12/14 08:09, <a class=3D"moz-txt-l=
ink-abbreviated" href=3D"mailto:squelart@gmail.com">squelart@gmail.com</a> =
a
      =C3=A9crit=C2=A0:<br>
    </div>
    <blockquote
      cite=3D"mid:1b00c799-b47e-48b7-8717-9953b1845cca@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">On Wednesday, December 3, 2014 7:37:24 PM UTC+11,
        Andrzej Krzemie=C5=84ski wrote:
        <blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left:
          0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
          <div dir=3D"ltr">W dniu =C5=9Broda, 3 grudnia 2014 05:21:27 UTC+1
            u=C5=BCytkownik <a moz-do-not-send=3D"true">sque...@gmail.com</=
a>
            napisa=C5=82:
            <blockquote class=3D"gmail_quote"
              style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc
              solid;padding-left:1ex">
              <div dir=3D"ltr">(First time here, please let me know if I'm
                doing anything wrong!)<br>
                <br>
                Just a quick idea I couldn't find elsewhere with a quick
                search, I was wondering if it had already been proposed
                and/or rejected:<br>
                <br>
                Would it be possible and useful to allow variable
                declarations inside a test preceding a block, and make
                these variables visible inside the remainder of the test
                and the block?<br>
                (The "remainder of the test" part might be going too
                far?)<br>
                The goal is to avoid polluting a block with variables
                that are really only needed inside an inner block.<br>
                <br>
                E.g.:<br>
                <div
style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);bo=
rder-style:solid;border-width:1px;word-wrap:break-word"><code>
                    <div><span style=3D"color:#008">if</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">((</span><span
                        style=3D"color:#008">auto</span><span
                        style=3D"color:#000"> total </span><span
                        style=3D"color:#660">&lt;</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#008">auto</span><span
                        style=3D"color:#000"> max </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> getMax</span><span
                        style=3D"color:#660">())</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">-</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#008">auto</span><span
                        style=3D"color:#000"> buffer </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> max </span><span
                        style=3D"color:#660">/</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#066">3</span><span
                        style=3D"color:#660">))</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">&gt;</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#066">1</span><span
                        style=3D"color:#660">)</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">{</span><span
                        style=3D"color:#000"><br>
                        =C2=A0 =C2=A0 </span><span style=3D"color:#800">// =
'total',
                        'max' and 'buffer' are visible in this block and
                        destructed at the end.</span><span
                        style=3D"color:#000"><br>
                      </span><span style=3D"color:#660">}</span><span
                        style=3D"color:#000"><br>
                        <br>
                      </span><span style=3D"color:#008">while</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#008">nullptr</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">!=3D</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#008">void</span><span
                        style=3D"color:#660">*</span><span
                        style=3D"color:#000"> buffer </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> malloc</span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#066">8</span><span
                        style=3D"color:#660">)))</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">{</span><span
                        style=3D"color:#000"> foo</span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#000">buffer</span><span
                        style=3D"color:#660">);</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">}</span><span
                        style=3D"color:#000"><br>
                        <br>
                      </span><span style=3D"color:#008">for</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#008">int</span><span
                        style=3D"color:#000"> i </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#066">0</span><span
                        style=3D"color:#660">;</span><span
                        style=3D"color:#000"> i </span><span
                        style=3D"color:#660">&lt;</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#008">int</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#008">end</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#066">10</span><span
                        style=3D"color:#660">);</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">++</span><span
                        style=3D"color:#000">i</span><span
                        style=3D"color:#660">)</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">{</span><span
                        style=3D"color:#000"> cout </span><span
                        style=3D"color:#660">&lt;&lt;</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#008">end</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">-</span><span
                        style=3D"color:#000"> i</span><span
                        style=3D"color:#660">;</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">}</span><span
                        style=3D"color:#000"><br>
                        <br>
                      </span><span style=3D"color:#008">switch</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#008">char</span><span
                        style=3D"color:#000"> c </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> getchar</span><span
                        style=3D"color:#660">())</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">{</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#008">case</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#080">'\0'</span><span
                        style=3D"color:#660">:</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#008">break</span><span
                        style=3D"color:#660">;</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#008">default</span><span
                        style=3D"color:#660">:</span><span
                        style=3D"color:#000"> cout </span><span
                        style=3D"color:#660">&lt;&lt;</span><span
                        style=3D"color:#000"> c</span><span
                        style=3D"color:#660">;</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">}</span><span
                        style=3D"color:#000"><br>
                        <br>
                      </span><span style=3D"color:#008">auto</span><span
                        style=3D"color:#000"> f </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#000">P</span><span
                        style=3D"color:#660">*</span><span
                        style=3D"color:#000"> p </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> maybeP</span><span
                        style=3D"color:#660">())</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">?</span><span
                        style=3D"color:#000"> p</span><span
                        style=3D"color:#660">-&gt;</span><span
                        style=3D"color:#000">foo</span><span
                        style=3D"color:#660">()</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">:</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#066">0</span><span
                        style=3D"color:#660">;</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#800">// Too far again?</span><span
                        style=3D"color:#000"><br>
                      </span></div>
                  </code></div>
                <br>
                Any pointers/suggestions/<wbr>criticisms welcome.<br>
                I'd be happy to work on it further if there's any
                interest.<br>
              </div>
            </blockquote>
            <div>=C2=A0</div>
            <div>Note that some of the above constructs are already
              valid in C++.<br>
              <code><span style=3D"color:#000"><br>
                </span>
                <div
style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);bo=
rder-style:solid;border-width:1px;word-wrap:break-word"><code>
                    <div><span style=3D"color:#008">while</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#008">void</span><span
                        style=3D"color:#660">*</span><span
                        style=3D"color:#000"> buffer </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> malloc</span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#066">8</span><span
                        style=3D"color:#660">))</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#800">//</span><span
                        style=3D"color:#000"><br>
                        =C2=A0 foo</span><span style=3D"color:#660">(</span=
><span
                        style=3D"color:#000">buffer</span><span
                        style=3D"color:#660">);</span><span
                        style=3D"color:#000"> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span
                        style=3D"color:#800">// valid C++</span><span
                        style=3D"color:#000"><br>
                        <br>
                      </span><span style=3D"color:#008">for</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#008">int</span><span
                        style=3D"color:#000"> i </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#066">0</span><span
                        style=3D"color:#660">,</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#008">end</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#066">10</span><span
                        style=3D"color:#660">;</span><span
                        style=3D"color:#000"> i </span><span
                        style=3D"color:#660">&lt;</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#008">end</span><span
                        style=3D"color:#660">;</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">++</span><span
                        style=3D"color:#000">i</span><span
                        style=3D"color:#660">)</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#800">// different than your
                        example</span><span style=3D"color:#000"><br>
                      </span><span style=3D"color:#660">{</span><span
                        style=3D"color:#000"> cout </span><span
                        style=3D"color:#660">&lt;&lt;</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#008">end</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">-</span><span
                        style=3D"color:#000"> i</span><span
                        style=3D"color:#660">;</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">}</span><span
                        style=3D"color:#000"> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span
                        style=3D"color:#800">// but similar functionality</=
span><span
                        style=3D"color:#000"><br>
                        <br>
                      </span><span style=3D"color:#008">switch</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#008">char</span><span
                        style=3D"color:#000"> c </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> getchar</span><span
                        style=3D"color:#660">())</span><span
                        style=3D"color:#000"> =C2=A0</span><span
                        style=3D"color:#800">// valid C++</span><span
                        style=3D"color:#000"><br>
                      </span><span style=3D"color:#660">{</span><span
                        style=3D"color:#000"> <br>
                      </span><span style=3D"color:#008">case</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#080">'\0'</span><span
                        style=3D"color:#660">:</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#008">break</span><span
                        style=3D"color:#660">;</span><span
                        style=3D"color:#000"> <br>
                      </span><span style=3D"color:#008">default</span><span
                        style=3D"color:#660">:</span><span
                        style=3D"color:#000"> cout </span><span
                        style=3D"color:#660">&lt;&lt;</span><span
                        style=3D"color:#000"> c</span><span
                        style=3D"color:#660">;</span><span
                        style=3D"color:#000"><br>
                      </span><span style=3D"color:#660">}</span><span
                        style=3D"color:#000"><br>
                        <br>
                      </span><span style=3D"color:#008">for</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#660">(</span><span
                        style=3D"color:#000">iter</span><span
                        style=3D"color:#660">.</span><span
                        style=3D"color:#000">init</span><span
                        style=3D"color:#660">();</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#008">int</span><span
                        style=3D"color:#660">*</span><span
                        style=3D"color:#000"> i </span><span
                        style=3D"color:#660">=3D</span><span
                        style=3D"color:#000"> iter</span><span
                        style=3D"color:#660">.</span><span
                        style=3D"color:#008">next</span><span
                        style=3D"color:#660">();)</span><span
                        style=3D"color:#000"> </span><span
                        style=3D"color:#800">// valid C++</span><span
                        style=3D"color:#000"><br>
                        =C2=A0 </span><span style=3D"color:#008">use</span>=
<span
                        style=3D"color:#660">(*</span><span
                        style=3D"color:#000">i</span><span
                        style=3D"color:#660">);</span><span
                        style=3D"color:#000"><br>
                      </span></div>
                  </code></div>
                <span style=3D"color:#000"><br>
                </span></code>Your proposal offers only a bit more. The
              question is, whether the added value counterweights the
              costs of standardization effort, complicating the
              language, more rules for programmers to learn, compiler
              updates, etc. My personal answer (based on feelings and
              intuition only) is that it is not worth it.<br>
              <br>
              Regards,<br>
              &amp;rzej<br>
            </div>
          </div>
        </blockquote>
        <div><br>
          Thanks for your help, I didn't know about some of these.
          Always learning!<br>
          <br>
          I knew about "while (void* p =3D ...)", but it means the
          variable can only be tested for "falsiness", you can't have a
          test that declares a variable and compares it to an arbitrary
          non-false value.<br>
          <br>
        </div>
      </div>
    </blockquote>
    while ((void* p =3D ...) =3D=3D 0) ...<br>
    <blockquote
      cite=3D"mid:1b00c799-b47e-48b7-8717-9953b1845cca@isocpp.org"
      type=3D"cite">
      <div dir=3D"ltr">
        <div>But as you say, it's "only a bit more", so it's probably
          not worth the huge effort to change the language just for
          that...<br>
          <br>
        </div>
      </div>
    </blockquote>
    Agreed,<br>
    Vicente<br>
  </body>
</html>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--------------000904090105090508000106--

.
