brangdon@cix.co.uk (Dave Harris) wrote in message news:... > jimmaureenrogers@att.net (James Rogers) wrote (abridged): > > If your suggestion was adopted, how would it affect existing > > programs? > Some currently non-portable ones would become well-behaved. > > why would you ever *want* uninitialized variables? > Mainly for speed. We would want to be able to say, eg, > std::vector vec( 1000000, unitialised ); > to avoid writing a million zeros. Which I suspect makes it a > non-trivial language change. What is the type of "initialised"? Hmmm. Either you write a million zeros, or you write a million words with junk. Either way, the actual execution time will not change on typical machines. On the other hand, I could imagine unitialised as a special type (an enum), which told std::vector NOT to call the copy constructor on each element. In which case, what happens if I write: std::vector< std::string > vec( 1000000, uninitialized ) ; ? -- James Kanze GABI Software mailto:kanze@gabi-soft.fr Conseils en informatique orient�e objet/ Beratung in objektorientierter Datenverarbeitung 11 rue de Rambouillet, 78460 Chevreuse, France, T�l. : +33 (0)1 30 23 45 16 [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]