This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: operator new with placement


> From: Carlo Wood <carlo@runaway.xs4all.nl>
> To: egcs-bugs@egcs.cygnus.com
> Date: Tue, 12 Oct 1999 02:01:36 +0200 (CEST)

> I deperately need new with placement, but gcc-2.95.1 refuses
> to compile it.

Did you read:

  18.4  Dynamic memory management                  [lib.support.dynamic]

1 The header  <new> defines several functions that manage the allocation
  of  dynamic  storage  in  a  program.   It also defines components for
  reporting storage management errors.



  Header <new> synopsis

?  I thought it was self explanatory.  :-) Headers are those pesky
little files that you have to #include to see their functionality...

> But when I try to compile this:
> --------------------------
> class Something {
> };

> char place[sizeof(Something)];

> int main(void)
> {
>   Something* p = new (place) Something();
>   return 0;
> }
> --------------------------

Not a bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]