Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!wiley!poseidon!simpson From: simpson@poseidon.uucp (Scott Simpson) Newsgroups: comp.lang.c++ Subject: Re: Call of constructors by vectors Message-ID: <5025@wiley.UUCP> Date: 13 Jun 89 03:58:05 GMT References: <1904@mas1.UUCP> <6590146@hplsla.HP.COM> Sender: news@wiley.UUCP Reply-To: simpson@poseidon.UUCP (Scott Simpson) Organization: TRW Arcadia Project Lines: 30 > simpleCType x1; > >has no need to do such. >A better question is why does: > > SomeClass x[100]; > >with: > >inline SomeClass::SomeClass(){} > >cause 100 invocations of this do-nothing "initializer" whereas x1 does not >cause even 1 invocation of the do-nothing "initializer". . . . . . Stupid inews line count "feature" . . . . . Because the SomeClass initializer may do a "new" and you want 100 objects allocated. See Stroustrup section 5.5.5 page 162. What do I win? :-) Scott Simpson TRW Space and Defense Sector oberon!trwarcadia!simpson (UUCP) trwarcadia!simpson@usc.edu (Internet)