From 3641770372553850654
X-Google-Thread: 7894ca11fe,d47b345505a72a70
X-Google-Attributes: gid7894ca11fe,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII
Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!208.90.169.39!news.alt.net!frodo.cs.rpi.edu!not-for-mail
From: Mathias Gaunard <loufoque@gmail.com>
Newsgroups: comp.std.c++
Subject: Re: for-else: adding else to for loops
Date: Sat,  8 Aug 2009 09:54:47 CST
Organization: http://groups.google.com
Lines: 21
Sender: cppmods@cs.rpi.edu
Approved: stephen.clamage@sun.com
Message-ID: <aba05dcd-8b4f-496d-a6cb-2058ea237ff6@f10g2000vbf.googlegroups.com>
References: <5d82cd6c-2a22-4dd7-8c7d-790b579533ea@d15g2000prc.googlegroups.com>
  <bc630f0f-6189-418e-917e-77328a08dbe6@d34g2000vbm.googlegroups.com>
NNTP-Posting-Host: netlab.cs.rpi.edu
Content-Type: text/plain; charset=ISO-8859-1
To: (Usenet)
Return-Path: <cppmods@ruralroute.cs.rpi.edu>
X-Original-Date: Sat, 8 Aug 2009 06:00:19 -0700 (PDT)
X-Submission-Address: std-c++@netlab.cs.rpi.edu
Xref: g2news2.google.com comp.std.c++:1239

On 8 ao�t, 00:24, Howard Hinnant <howard.hinn...@gmail.com> wrote:

> for (auto i : seq)
> {
>    cout << ", " << i;
>    for one   {cout << "The only number is " << i << '\n';}
>    for first {cout << "The numbers are " << i;}
>    for last  {cout << " and " << i << '\n';}}
>
> for none {cout << "There are no numbers\n";}

I would have expected cout << ", " << i to be executed in all cases
here, not only in the non-one, non-first and non-last cases.


-- 
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



