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=1.1 required=5.0 tests=BAYES_00,HEADER_SPAM, PP_MIME_FAKE_ASCII_TEXT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,b30bd69fa8f63cb2 X-Google-Attributes: gid103376,public X-Google-Thread: fc772,b30bd69fa8f63cb2 X-Google-Attributes: gidfc772,public X-Google-ArrivalTime: 2003-06-15 08:02:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!xmission!news-out.spamkiller.net!propagator2-maxim!news-in-maxim.spamkiller.net!usc.edu!rpi!not-for-mail From: John Potter Newsgroups: comp.lang.ada,comp.lang.c++.moderated Subject: Re: C bug of the day Date: 15 Jun 2003 11:04:43 -0400 Organization: EarthLink Inc. -- http://www.EarthLink.net Sender: cppmods@netlab.cs.rpi.edu Message-ID: References: <1054751321.434656@master.nyc.kbcfp.com> Reply-To: jpotter@penguin.lhup.edu NNTP-Posting-Host: netlab.cs.rpi.edu X-Original-Date: Sun, 15 Jun 2003 00:13:37 GMT X-Submission-Address: c++-submit@netlab.cs.rpi.edu X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated iQBVAwUAPuyLB0HMCo9UcraBAQGc/wH+JFwI/cgcYcTLASfnPkJ2aTQdZKS6ZKq/ EZ8XtWGx9kVVp1eKW9wySWDIcDExfdtpGEorjif5xaRdwvC5IBZFrw== =odHP Xref: archiver1.google.com comp.lang.ada:39198 comp.lang.c++.moderated:68397 Date: 2003-06-15T11:04:43-04:00 List-Id: On 14 Jun 2003 16:27:12 -0400, Francis Glassborow wrote: > In message , Terje Sletteb� > writes > >int i; > >stream >> i; > >Intialising "i" beforehand would just be vasteful. > Well yes, but any halfway competent programmer has a way to initialise a > variable from a stream, in my case I use my own template that allows me > to write: > int i(read(stream)); Let's see your template. My guess: template T read (istream& is) { T item; // uninitialized or default constructed is >> item; return item; } I'm guessing that you are just hiding the uninitialized fundamental or default constructing a udt. John [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ] [ about comp.lang.c++.moderated. First time posters: do this! ]