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.6 required=5.0 tests=BAYES_05,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-16 15:41:37 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!pd2nf1so.cg.shawcable.net!residential.shaw.ca!news-out.superfeed.net!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: 16 Jun 2003 18:43:50 -0400 Organization: Southfield Microcomputer SS Sender: cppmods@netlab.cs.rpi.edu Message-ID: References: Reply-To: Francis Glassborow NNTP-Posting-Host: netlab.cs.rpi.edu X-Original-Date: Mon, 16 Jun 2003 10:21:44 +0100 X-Submission-Address: c++-submit@netlab.cs.rpi.edu X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated iQBVAwUAPu5IGkHMCo9UcraBAQGxSAIAsT2hrHINfvXzV6EvD8JxGXyIFye7dZ25 Tg2JYdPcApvb1VqP13iiBXicL53rgUKZ1H++j6HcayIrlgYKzh0ldQ== =tQXt Xref: archiver1.google.com comp.lang.ada:39292 comp.lang.c++.moderated:68464 Date: 2003-06-16T18:43:50-04:00 List-Id: In message , John Potter writes > > 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,. > >Your article was in the part of the thread talking about uninitialized >variables. You claimed that any decent programmer had a way around >that. The first line is all that counts and it matches your posted >code. The template does not solve the problem no matter how much >error testing you add. You still have a desirable uninitialized >fundamental and can not avoid default construction of udt. It is >possible to avoid the problem for udt with a constructor taking a >stream; however, that does not generalize to a universal template. > >Not a question of the quality of your code. Just a guess that it had >nothing to do with the subject. QED. Yes, as you point out, I missed the point. The title to the thread is unhelpful and it has split into several sub-threads which makes it difficult to remember the context in which source code is offered. I suspect that I am not the only reader to loose track. However note that I strongly advocate that operator >> for streams be regarded with as much suspicion as delete. Both should be suitably encapsulated. -- 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! ]