home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19845 < prev    next >
Encoding:
Text File  |  1993-01-24  |  1.1 KB  |  28 lines

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