home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!utcsri!helios.physics.utoronto.ca!alchemy.chem.utoronto.ca!plumbum.chem.utoronto.ca!mbersohn
- From: mbersohn@alchemy.chem.utoronto.ca (M. Bersohn)
- Subject: When Are Global Objects with a Constructor Initialized?
- Message-ID: <1993Jan25.024402.10801@alchemy.chem.utoronto.ca>
- Originator: mbersohn@plumbum.chem.utoronto.ca
- Sender: news@alchemy.chem.utoronto.ca (USENET news)
- Organization: University of Toronto Chemistry Department
- Date: Mon, 25 Jan 1993 02:44:02 GMT
- Lines: 16
-
- Hello C++ experts:
- Does anyone know when global objects of a class with
- a constructor that does initializations are initialized,
- at compile time or at the beginning of execution?
-
- One might ask "Why care?". I intend to have
- over 100,000 of such objects so I don't want to
- proceed in this way if they all have to be initialized
- at the beginning of every run of the program.
-
- Thank you in advance.
- Malcolm Bersohn
- mbersohn@alchemy.chem.utoronto.ca
- P.S. I'm aware that aggregates with an initialization list
- are initialized at compile time, but a constructor looks
- like code that is executed.
-