Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!pasteur!dogwood.Berkeley.EDU!faustus From: faustus@dogwood.Berkeley.EDU (Wayne A. Christopher) Newsgroups: comp.lang.c++ Subject: Calling constructors on already allocated data Message-ID: <13096@pasteur.Berkeley.EDU> Date: 30 Apr 89 22:47:11 GMT Sender: news@pasteur.Berkeley.EDU Lines: 9 Is it possible to call a constructor on data that has already been allocated? I have a buffer that I want to put some objects into, but I don't know what objects and their order until runtime. I can think of a few ways to do this -- cast the contents of the pointer into the type and let the casting function do the work, or create an auto variable, then assign it to the contents of the buffer. Is there a better way? Wayne