"Asger K. Alstrup Nielsen" <[EMAIL PROTECTED]> writes:

| > Lars> You cannot use a constructor on an array allocation.
| > 
| > Ahhhha! So my compiler is correct! I must say though that this is bad design by
| > the standards commitee, (IMHO of course).
| 
| Actually, it is possible to use a constructor on an array allocation.
| 
| This is called "placement new". Read all about it in "More effective C++"
| by Scott Meyers.

Are you sure you have not missuderstood placement new?

 char * uninit_mem = new char[100];
 LyXFont * font = new (uninit_mem) font(LyXFont::sane);

I thought that was the usage, but of course I have never used it.

        Lgb

Reply via email to