From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HEADER_SPAM,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc772,b30bd69fa8f63cb2 X-Google-Attributes: gidfc772,public X-Google-Thread: 103376,b30bd69fa8f63cb2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-14 18:52:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uwm.edu!rpi!not-for-mail From: Wesley Groleau Newsgroups: comp.lang.ada,comp.lang.c++.moderated Subject: Re: C bug of the day Date: 14 Jun 2003 21:54:47 -0400 Organization: Ain't no organization here! Sender: cppmods@netlab.cs.rpi.edu Message-ID: <9PWcnbLRQfCMCHajXTWcpQ@gbronline.com> References: <1054751321.434656@master.nyc.kbcfp.com> Reply-To: wesgroleau@despammed.com NNTP-Posting-Host: netlab.cs.rpi.edu X-Original-Date: Sat, 14 Jun 2003 16:35:23 -0500 X-Submission-Address: c++-submit@netlab.cs.rpi.edu X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated iQBVAwUAPuvR40HMCo9UcraBAQHhMQIAooaXxuKqAEbQApCNa5+/BIuqcMHm/7Pr qQ6nngxrhMyoPfZB4W+G9eLi1/BOk/CGUaE+zSvHEiOa6XMPCOIqKQ== =a8CX Xref: archiver1.google.com comp.lang.ada:39191 comp.lang.c++.moderated:68383 Date: 2003-06-14T21:54:47-04:00 List-Id: > > > If your suggestion was adopted, how would it affect existing > > > programs? For that matter, why would you ever *want* uninitialized > > > variables? > > > > Reading from streams is an obvious example: > > > > int i; > > > > stream >> i; > > > > Intialising "i" beforehand would just be vasteful. I would think even a mediocre compiler would optimize away an obiously useless initialization. > > It wouldn't break anything, just make it a tiny bit slower. If you allowed something to inidicate > uninitialized, you could get the performance back. > > int i; // initialize to 0 > stream >> i; > > auto int i; // recycle auto to mean uninitialized. > stream >> i; Wouldn't it be better to have the old syntax do the same thing? Also, doesn't "auto int" have a tiny hint of doing something automatic to the int (as opposed to _not_ doing something)? [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ] [ about comp.lang.c++.moderated. First time posters: do this! ]