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=2.1 required=5.0 tests=BAYES_20,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-15 14:53:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!nntp-relay.ihug.net!ihug.co.nz!news-out.newsfeeds.com!propagator2-maxim!news-in-maxim.spamkiller.net!usc.edu!rpi!not-for-mail From: Francis Glassborow Newsgroups: comp.lang.ada,comp.lang.c++.moderated Subject: Re: C bug of the day Date: 15 Jun 2003 17:55:12 -0400 Organization: Southfield Microcomputer SS Sender: cppmods@netlab.cs.rpi.edu Message-ID: References: <1054751321.434656@master.nyc.kbcfp.com> Reply-To: Francis Glassborow NNTP-Posting-Host: netlab.cs.rpi.edu X-Original-Date: Sun, 15 Jun 2003 16:49:01 +0100 X-Submission-Address: c++-submit@netlab.cs.rpi.edu X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated iQBVAwUAPuzrMEHMCo9UcraBAQFCugH/RDMs737wXHbcAyD6wB1rACSXAgEcXplt xLfQepNY9u3gngGMqICiVGoulHNcQ13Ysj2+/eGh3BdLzhmC8K/cyQ== =6Clc Xref: archiver1.google.com comp.lang.ada:39210 comp.lang.c++.moderated:68409 Date: 2003-06-15T17:55:12-04:00 List-Id: In message , John Potter writes >> 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. Come on, I can write better code than that. The main point was that input should be at least validated as appropriate to the type,. -- ACCU Spring Conference 2003 April 2-5 The Conference you should not have missed ACCU Spring Conference 2004 Late April Francis Glassborow ACCU [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]